Category Archives: php development

Php is a popular web development language for the 2000’s. There are other newer languages, however, php has remained a stable in the web development industry.

Javascript and PHP Size Based Styles

Javascript and PHP Size Based Styles

So you want to support different screen resolutions do you? Well, it is possible too much difficulty by creating a multiplexer for CSS files. This solution I am speaking about involves creating several style sheets for popular screen resolution groups and a cookie to save the information and redirecting when the cookie is not set. This solution should be handled with care as cookies are not always supported and could create and endless redirect.

Continue reading

PHP SNI Switch for HTTPS WINXP IE

PHP SNI Switch for HTTPS WINXP IE

A possible solution to an Error page for HTTPS SNI in WinXP Internet Explorer

Although this is not the best way to treat this situation, it is possible to have a switch for the Internet Explorer XP Browser in order to treat it specifically when hosting multiple sites with one ip and https. For those of you looking for the answer:

Continue reading

MySQL Singleton Class to allow easy and clean access to common mysql commands

The MySQL Database class is implemented using the singleton design pattern. This design pattern allows for only one single instance of the object. This one instance can then be obtained through a static method. This provides a convenience in that you can get your database object from anywhere in your code.
Continue reading

Database PHP Session Handling

Database PHP Session Handling

As you should be aware the HTTP protocol, as used for serving web pages, is completely stateless. This means that after the server has received a request, processed it and sent a response, the process which dealt with that request dies. Anything that the process had in its memory therefore dies with it, so when a subsequent request is received from the same client it is unable to refer to its memory about anything that happened previously.
Continue reading

How to ZIP files with PHP

Most web servers these days run on a LAMP configuration (Linux, Apache, MySQL, PHP). Because the Operating System is Linux, the default archival and compression utilities are TAR and GZIP resulting in files like “filename.tar.gz”. There is nothing wrong with these utilities, however, if you are providing a visitor to your web site with a dynamic download of archived files you would probably want to provide the files in the very well known compressed format (typically used on Windows OS computers).

Restoring MySQL Dump with PHP

As web developers, we are usually tasked with deploying a project to a production server that we don&squo;t always have access to. And in most cases the projects require a database. The usual plan of action consists of running a database dump, copying the sql sump file over to the production server, and restoring the dump file using the MySQL CLI. However, in cases where we have limited access to the production server including no shell access, results in the problem: How do we install the database.