Tag Archive | "php"

Turn off error reporting on your production site

Wednesday, October 1, 2008

3 Comments

Turn off error reporting on your production site

On a production site, you would most likely want to hide all possible PHP errors, warnings and notices from your users for both usability, presentational and security purposes.

Continue reading...

Wordpress.com Stats Stopped Working

Wednesday, August 6, 2008

0 Comments

I recently integrated a blog and documentation base into the Tribulant.com website and noticed after a few days that my Wordpress.com stats stopped working completely after switching the theme.

Continue reading...

PHP : Increase memory limit

Tuesday, August 5, 2008

0 Comments

Have you ever received a fatal error on your server similar to the one below when you tried to execute a script? The fatal error shown below, indicates that your PHP configuration has a memory limit set and the script which you are executing is trying to allocate more memory than what is available for use.

Continue reading...

PHP : Date difference in days

Tuesday, June 17, 2008

3 Comments

You might need to calculate the date difference in days using PHP. You can easily calculate the days difference by using something like the code below.

Continue reading...

PHP : Array to Object

Tuesday, May 6, 2008

4 Comments

I wrote a quick and simple function which allows you to quickly convert arrays to objects. It allows you to change an array like this :

Continue reading...

PHP : Strip filename from a URL

Saturday, April 26, 2008

0 Comments

Using PHP, you might need to strip the path from a URL, leaving behind just the filename at the end of the URL. You can achieve this with a regular expression pattern of course, but I have a much simpler solution. See the example code below.

Continue reading...

CakePHP : Form Radio Default Checked Value

Thursday, April 17, 2008

0 Comments

With the CakePHP FormHelper, you can output a set or a list of radio button widgets.

Continue reading...

CakePHP Crontab

Thursday, February 28, 2008

1 Comment

Due to the way that CakePHP rewrites URL requests with its router, it might seem confusing to execute a Crontab to run a controller action. I will show you how to set up a cron dispatcher so that you can execute all your different controller action schedules on a single file and pass the controller [...]

Continue reading...

PHP : Cannot use a scalar value as an array

Tuesday, February 26, 2008

1 Comment

I was working on a Wordpress plugin today and came across the most disturbing PHP warning error which I have never seen before in all the time that I’ve worked with PHP. The warning error message was : Warning: Cannot use a scalar value as an array What caused this error was when I tried to append [...]

Continue reading...

Xampp phpMyAdmin Problem

Saturday, February 23, 2008

1 Comment

I started XAMPP today and tried to open phpMyAdmin (http://localhost/phpmyadmin/) in my browser in order to do some database management. Unfortunately I was presented with the following error message : cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly After playing around a bit, [...]

Continue reading...