sqlite3; I am falling in love..

After about a decade of php and mysql, with just deviating only in the scripting or language area, today morining, I felt like digging into the sqlite3, which a lot of people are referring to, and some good RIA players are paying attention to also. The big names that sqlite website brags about are Adobe, Symbian and Firefox.

Jumping straight into the hands on, though for a prologe or introduction I will brief the respective situation. Kyle Newton of Galaxy WD, a client of Saturn SPL wanted a website to have the famous USAPostalCodes db, but he wanted the system to use pre imported flatfiles, and with about a couple of hours, we could pre import the USAPostalCodes db to the recommended format, though the whole data size was now 170MB. The pages where being generated on the webserver under 1/100 th of a second. Along with php ob_gzhandler was giving a good output. The client was almost satisfied, though he had some other views and that was not about the technology.

Continue reading “sqlite3; I am falling in love..”

Reduce Bandwidth usage in PHP

While searching on the net with the title as search terms, I landed on a page by Anthony Williams, which provoked me to probe more into optimizing all our javascripts too. Since our latest and greatest wordpress implementation at keralaonline, was getting 10K hits per day. I thought to try it out.
By combining the ideas of Anthony Williams and jsmin-php, I wrote a piece, and with the help of a RewriteRule, the famous mod_rewrite module of apache, I could optimize my page fetches a lot. It may take quite a few days before I can come out with any sort of bench marks. But still I am sure there is quite a change.
Continue reading “Reduce Bandwidth usage in PHP”

# PHP Programming Innovation Award

The PHP Programming Innovation Award is to provide recognition to developers who make outstanding contributions to the PHP community.

The award aims to honor developers who share components in the form of PHP classes of objects that provide innovative features or solve problems with approaches that provide additional value to the PHP applications of other developers.

The main goal of this award is to encourage developers to contribute PHP components that provide innovative features, instead of just replicating the features already provided by previously contributed components.

At the same time it is expected or hoped that the recognition and prizes, which can be earned by award nominees and winners, will motivate more capable developers, who otherwise would not participate, to make contributions.

The PHP community has grown naturally without a marketing force persuading developers to adopt it, unlike other languages that are backed by big companies with large budgets to invest in huge marketing campaigns.

This award also has an implicit goal to inspire other sites or companies to promote PHP and its community by means of other initiatives, hopefully different from this one, that focus on motivating and providing recognition to individuals or groups who make outstanding contributions to the PHP community and foster the continuation of its growth.

More Information

NANOWEB, a web server written entirely in PHP

NANOWEB is a http server written entirely in PHP 4.3. It does not need apache or any other server software to work, just the php4 binary.

As commented on the online manual, the installation was really easy with the command line tool handling the task. Though the configuration was a bit tough for me. Not that the configuration syntax, but finding the files was a bit confusing. Though only later on I came to know about the nanoweb-nanoconfig, an ubunty fiesty package which helps configuring nanoweb using a web interface.

Though the feature list is long, the full power can be achieved only in an os where php can provide the POSIX fork() call. I could find this enough for demonstration purposes, but for real heavy work, I still depend on a different application server.

The Power of Google Gears (Part 1)

by Jack Herrington
Web application development is the perfect 95 percent solution. It’s very easy to develop a simple HTML frontend to something like PHP or Rails, to deliver data to and from a MySQL database. You can even give it a more desktop feel by using Ajax tools. But that last five percent, the ability for desktop applications to work offline, was missing from the web world until the release of Google Gears.

Read the rest of the article

How ’bout writing a JavaScript template engine ?

Yea! a minimalistic one, without much xBrowser checks, would be as follows,

function render(o){
	if(!o.o) return;
	var rv = document.createElement(o.o);
	if(o.p){
		var pC = o.p.length - 1;
		for(var i = 0; i < pC; i += 2){
			rv.setAttribute(o.p[i], o.p[i+1]);
		}
	}
	if(o.c){
		var cC = o.c.length;
		for(var i = 0; i < cC; i++)
			rv.appendChild(render(o.c[i]));
			}
	if(o.txt)
		rv.innerHTML = o.txt;
   return rv;
}


Now what the heck is written above ? no wonder, it is just a recursive function which can handle json page structures. Only thing is that the page structuring can go heck and complex, though the renderer is too simple with only just a handful of statements. The var names are intentionally kept at a minimum to make the function lighter.
Continue reading “How ’bout writing a JavaScript template engine ?”

Devise Web 2.0 applications with PHP

DHTML is HTML that includes JavaScript code that changes the content or layout of the page in the browser without going back to the server. When you write an HTML page, you’re actually writing an object tree. All the tags — the little <table>s and <p>s — become objects in the JavaScript space. Using JavaScript, you can change their content, Cascading Style Sheets (CSS) styling, and location — all without ever going back to the server. DHTML is the intersection of HTML, CSS, and JavaScript.

The technology to use DHTML has been around since the addition of JavaScript code to the browser, but support for it has been spotty. Microsoft® Internet Explorer did an excellent job early on, but during the same period, Netscape V4 lacked support. Recently, Mozilla and Firefox have stepped up with solid DHTML support, and some believe the pendulum has swung so far that Internet Explorer is now behind the curve.

Read the whole article

PHP Mime Mail Class

There are a lot out there; but my favourite is been PHPMailer

I was always on the look for a decent php mail class with smtp auth and mime mail support.  Then one day stumbled on this sourceforge project. There it was with other features too which I wished to have

  1. Can send emails with multiple TOs, CCs, BCCs and REPLY-TOs,
  2. Redundant SMTP servers, Multipart/alternative emails for mail clients that do not read HTML email,
  3. Support for 8bit, base64, binary, and quoted-printable encoding,
  4. Uses the same methods as the very popular AspEmail active server (COM) component,
  5. SMTP authentication,
  6. Word wrap,
  7. Address reset functions,
  8. HTML email,
  9. Tested on multiple SMTP servers: Sendmail, qmail, Postfix, Imail, Exchange, etc,
  10. Works on any platform,
  11. Flexible debugging,
  12. Custom mail headers,
  13. Multiple fs, string, and binary attachments (those from database, string, etc),
  14. Embedded image support

PHP HTML Form Generation and Validation

A PHP class for HTML easy form generation and validation. It provides an easy and intuitive way of handling both HTML form design (based on templates) and basic server-side form validation. Custom validation (both server-side and client-side) can also be implemented very easily. It provides all the basic controls available in an HTML form like text controls, textarea controls, submit buttons, reset buttons, standard buttons, drop down boxes, radio buttons, checkboxes, image controls, hidden controls, file upload controls, password controls and a date picker control.

View Website

Form Tools

Form Tools is written for web developers who work on online registration sites, or sites that require any form of information gathering from their online visitors. Put simply, it is a form processor, storage and data access script written in PHP and MySQL, designed to work with any existing web form. With a few minor changes to your form, you can stop using old-fashioned form-mail scripts and instead store form submissions in a database, instantly providing your clients with options such as mass data export via Excel, printer-friendly pages, data searching and sorting, form submission editing and optional email of form submissions to administrators and users. Form Tools is available for free under the GNU public license. See the website for an online demo, documentation, support forums or just to download the code!

Visit Website