Archive for September, 2009

If you need to change the page that users see when a document is not found, create: /app/views/errors/error404.thtml

You can use the cache feature in cakePHP. Have look at the following code. APP -> CONFIG -> CORE.PHP // Access the following code in APP -> CONFIG -> CORE.PHP /** * Turn on all caching application-wide. * */ Configure::write(‘Cache.disable’, false);

- run (as an administrator) php.exe -i > C:\phpinfo.txt and go open C:\phpinfo.txt, look in the file to see if CURL was loading, if it’s there then keep reading. – running inside a text.php script on my IIS server would not show CURL loading – A permissions problem on libeay32.dll and ssleay32.dll was causing the cli version of php allowing me access to …

This is incorrect: echo ‘abc’; session_start(); This is Right: session_start(); Please note: Always write session_start() at the very first line

jQuery code snippet: $(‘#username’).keyup(function() { if ($(‘#username’).val() != ”) { $(‘#submit’).removeAttr(‘disabled’); } else { $(‘#submit’).attr(‘disabled’, ‘disabled’); } }); It ensures that the submit button is only enabled if the “username” input field is not empty (you can see such a behavior on twitter for example). However, the snippet from above can be rewritten in a shorter and more elegant way: $(‘#username’).keyup(function() { $(‘#submit’).attr(‘disabled’, …

MyISAM static all the fields have fixed width. The Dynamic MyISAM table would include fields such as TEXT, BLOB, etc. to accommodate the data types with various lengths. MyISAM Static would be easier to restore in case of corruption, since even though you might lose some data, you know exactly where to look for the beginning of the next record.

PHP provides a lot of facilities and possibilities: PHP provide an easy way to create a Web page to make it more useful for users. Do you have a guestbook on your website? Do you subscribe to a third-party service that provides statistics on site visitors? Would you like to know how a user got in to your web page, where they visited …