Archives

Posts Tagged ‘php’

Uploaded images from user can be of any size.  If you need to use these images, they need to be resized upon upload. Here is a helper class to manage resizing of the images. Let me know if you find any bugs.

Jul 27th, 2008 | Filed under php
Tags:

I would not recommend to enable register_globals, but if you need to enable the register_globals for a particular web folder, you can edit the .htaccess file and append the following to it php_flag register_globals on Restart apache and you are on your way.

Jun 17th, 2008 | Filed under apache, php
Tags: ,

PHPImpact has posted 30 useful PHP classes here. Which ones do you use? I have used the following: Propel phpDocumentor Securimage Smarty Still a lot more interesting ones which I haven’t tried.

May 30th, 2008 | Filed under php
Tags:

Any time you put something in “double” quotes, you are asking PHP interpreter to check that content for a variable. So even though the line do not contain variables within the double quotes, PHP will waste precious computing time scanning them anyway. $sql = ‘select * from employee’; will be much faster than $sql = […]

May 27th, 2008 | Filed under php
Tags:

If you have multiple mysql connections (i.e. mysql_connect() or mysqli_connect()) on the page you will need to specify the the connection you are using when calling this function. example: mysql_insert_id($MY_CONN);

Feb 29th, 2008 | Filed under php
Tags: ,

If you ever need to download a HTTP/FTP or any page, try not to use fopen() and fread() functions. They work but will take enormous amounts of time as compared to curl functions. Try doing as follows: To GET a page using a url <? $url=”http://any.url”; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, […]

Aug 13th, 2007 | Filed under php
Tags:

I was looking for a quick reference/tutorial to implement Data Objects with PHP, very similar to what exists in Java. Found a nice explanation at PHP Data Object

Aug 8th, 2007 | Filed under php
Tags: