Archive for the ‘php’ Category

For Windows machine running WAMPServer: 1) Install PDT plugin on your eclipse 2) Download XDebug to match your php 3) Install XDebug – save XDebug dll to wamp_path/bin/php/php5.3.5/ext folder 4) Enable XDebug – update php.ini file 4a) comment zend debugger information 4b) enable xdebug [xdebug] xdebug.remote_enable = on xdebug.profiler_enable = off xdebug.profiler_enable_trigger = off ; […]

Jun 7th, 2011 | Filed under apache, php, Windoze

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

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

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

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: ,

No matter what web based technology you are using,  these tips will always be helpful when it comes down to uploading files:  Keep uploaded files where they cannot be directly accessed by the users via a direct URL. This can be done either by storing uploaded files outside of the web root or configuring the […]

Feb 4th, 2008 | Filed under general web, java, php

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

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