May 24th in PHP Scripts by pbu .

how to store and retrieve checkbox value in php?

how to store and retrieve checkbox values in mysql database with php

I was working on a project and i had landed in an awkward situation, where i have to save the tick box values in a database and once done, i had to retrieve those values and present it to the user for editing. i searched everywhere on the web on how to store and retrieve check box values and the answers are hard to find. So i have decided …

April 27th in PHP Scripts by pbu .

Cakephp vs CodeIgniter – which is best php framework?

Today i went through some of the easy to use PHP frameworks, ideal for developing rapid php applications and websites with ease of use.

I did a study on following php toolkits and i was pretty impressed with codeigniter and it is the best easy to use php framework i have seen. All the frameworks work based on MVC (Model View Controller). All the frameworks are open source and licensed GPL or MIT license.

CakePHP – http://cakephp.org/
CodeIgniter – http://www.codeigniter.com
PHPLib – http://phplib.sourceforge.net
Symphony …

April 22nd in PHP Scripts by pbu .

[Fix] Fatal error: Unable to read 25447 bytes in index.php

I purchased a commercial software which needed Zend optimizer since it was encoded one. I uploaded all my scripts to my linux server and suddenly i got this error when accessing the site.

Fatal error: Unable to read 25447 bytes in index.php

I did have Zend optimizer installed in our cpanel server and didnt know how to fix this problem. Sooner we found the culprit was FTP software.

Fix:

Since the scripts are encoded, you have to upload the php files in BINARY …

March 23rd in PHP Scripts by pbu .

Single/double quotes causes error in mysql INSERT query!

Today i learned a valuable lesson despite being a good mysql/php programmer i failed to follow the basics. My client kept on complaining that there was an error popping up in my website whenever she submitted a form. I wasnt sure what it is and my client was kind enough to email me .

and the error was

Insertion Failed:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to …

March 19th in PHP Scripts by pbu .

Alternative to smarty templates_c folder 777 permission!

i have often used smarty with php as it separates the application from the presentation. If you use smarty then it is a must to set 777 writable permission to templates_c folder, only then your site will work properly.

Many people are afraid to set 777 writable permission which means anybody could write on the server which leaves more vulnerable. If you dont set 777 permission smarty will throw up this error

Smarty error: unable to read resource: XXX in …

March 1st in PHP Scripts by pbu .

PHP script to check server status online/offline

i wrote a simple php script to check whether the website or Ip address is online or offline. All you have to do is specify a website url or ip address and the script will return with ONLINE or OFFLINE. I used php fsockopen() to accomplish this.

/* Usage:
$status = GetServerStatus(‘http://domain.com’,80)
or
$status = GetServerStatus(‘IPAddress’,80)
*/

<?php
function GetServerStatus($site, $port)
{
$status = array("OFFLINE", "ONLINE");
$fp = @fsockopen($site, $port, $errno, $errstr, 2);
if (!$fp) {
return $status[0];
} else
{ return $status[1];}
}
?>

If you want to …

February 28th in PHP Scripts by pbu .

PHP – How to get domain name from URL?

i was working on a recent project and suddenly i wanted to extract domain name domain.tld stripping off www or http://

I know that parse_url() is the function that accomplishes most of the task. I have tested this function and if users type with www.domain.com then domain.com is only available with path array variable and not in host array variable whereas with http:// the domain.com comes in host array. This is a tricky problem when parsing url to get domain …

February 18th in Javascript, PHP Scripts by pbu .

Top Best Web based WYSIWYG html editors (Free)

Best WYSIWYG HTML Editors

I have been searching for some of best web based html editors written in javascript so that i can integrate it with my scripts. I have found pretty nice open source wysiwyg editors so i decided to blog it here.

Please note that some of the editors are just markup editors, which i believe a pretty good alternative to web applications needing lightweight editor. I very much prefer using markup editors keeping simple with just textarea than …

November 29th in Linux/Unix, PHP Scripts by pbu .

Fix -> PHP files are downloading when viewed in Browser

i had a sudden wierd problem with my site running cpanel. when ever i click on the link in my website, the browser shows a download box for the php file instead of showing a webpage. I did use mod rewrite to make url friendly

How to Fix

I figured out later the problem is apache doesnt know to parse those files with php. You you have to create a file .htaccess in your site public_html folder and place the following …

November 26th in Linux/Unix, PHP Scripts by pbu .

CPU Exceeded Error on a New Host

i recently faced a real problem because of this. I decided to move from bluehost because my site kept receiving “cpu exceeded error” page frequently. I moved to a new dedicated server host running cpanel. I did a SCP cpanel account restore and very strangely, when i type my domain in my browser i again see, “cpu exceeded error”. It kept redirecting to blue host cpu exceeded page. That too in my new dedicated server.

It was very weird until i …

 Page 2 of 5 « 1  2  3  4  5 »