Ibrahim Abdel Fattah Mohamed Personal bLOG - when rabbits rule!..

Status Report-04

By: bingorabbit, July 17, 2008 @ 09:12 am
Filed under: college, depiak, dreams, linux, php, wordpress
Tags: , , , , , , ,

ICU, My Grandpa, Family! Al-7amdolelah

2008-07-17 :) , wemabre7 kan 3omry 20 :)

I’m waiting for my results..

I will be having an interview after ummmm 5 hours?&!

depiak, good work and a great comeback!

I love Linux!! - Mosh awy -

Wordpress 2.6, again, they always impresses me!

PHP, MySQL, Java and SCJP!

Smileys, again

Error Reporting

By: bingorabbit, June 12, 2008 @ 04:09 am
Filed under: information.technology, linux, php, web
Tags: , ,

One of the most amazing features in php is how it shows errors to the developer, you might think of it as a GPS which tells you exactly where you have to go :) ; Line Number, character and the error itself..CHARM!

Through the whole previous 2 years, I didn’t use error reporting at all, because it was off by default on my localhost - I use Fedora with Apache, php and MySQL installed as my localhost,, I even installed phpMyAdmin :) . -. I didn’t even mind to set it on, may be because I didn’t right that HUGE script that I may search for an error in and get lost. I have to tell that this really enhances your skills a bit, because you become more into code trying to figure out the semi-colon that you forgot and it terminated the script with a blank screen. Anyway, today I thought about giving it a try so I had to do it manually so you should do the following:


$ su -

- then enter the root's password and press enter -

# vi /etc/php.ini

Search for “Error handling” (type /Error handling and press enter in vi), this is where the error handling and logging configuration block starts. Try to find the statement where it says:


;error_reporting = E_ALL

If it had a semi-colon (;) in the beginning, just remove it, if there where no semi-colons - the common situation - , go to the next step.

Next, search for “display_error” (type /display_errors and press enter in vi), mostly you will find this equals Off so you will find it saying:


display_errors = Off

Change the “Off” to “On”, save the configuration file ( Shift+ZZ in vi) and issue the following command to restart the web server service:


# service httpd restart

If you had any problems, please report them here. :)

parameters with default values

By: bingorabbit, June 11, 2008 @ 18:24 pm
Filed under: information.technology, linux, my.hacks, php, web
Tags: , , , ,

It’s known that declaring a php function has the following syntax:

<?php
function function_name(Parameters_list) {
// function
// code
// block
}
?>

an example of this can be like this:

<?php
function nameAndAge($name,$age){
echo "Welcome $name, you are $age years old!";
}
?>

When I issue the following statement:

<?php
nameAndAge("bingorabbit",20);
?>

I will get:
Welcome bingorabbit, you are 20 years old!

Most of us know that, and also we know that to set a default value for any parameter, we can do the following:

<?php
function function_name($parameter1 = "default value", rest_of_the_parameter_list) {
// function
// code
// block
}
?>

which might take the following form:

<?php
function nameAndAge($name="bingorabbit",$age){
echo "Welcome $name, you are $age years old!";
}
?>

so when I issue:

<?php
nameAndAge();
?>

I will get:
Welcome bingorabbit, you are years old!

and when I issue:

<?php
nameAndAge("Ahmed", 15);
?>

I will get:
Welcome Ahmed, you are 15 years old!

The problems is such declaration is that, you can’t just issue:
Read More..