Thursday, January 29, 2009

Include vs Include_Once and Require vs Require_Once - PHP


The include function simply includes a file, and that is all. If the file isn't found a warning is raised, but the script will continue to execute.


Require has very similar functionality to include(). However, if a file is not found a warning will be raised and the script will halt completely.

Include_Once() and Require_Once()

You should use these functions if you do not want to include a file multiple times (which can cause errors with functions and classes).


file1.php includes file2.php and file3.php.
file2.php also includes file3.php

Without the _once() functions file3 will be included twice, but with the _once() function it will only be included once.

source :

Monday, January 19, 2009

How many of u have noticed this

This is one of the electric post that you can see at Dehiwela junction, Sri Lanka.
See how many threads are tied up on that... :)

I cannot start the x server

In our lab... one day suddenly we got following error message when we boot the Redhat 9 Linux machines.

"I cannot start the x server it is likely that it is not setup correctly would you like to view the x server output to diagnose the problem"

When we trace the problem found that this is something with display setup problem. It seems that, any display configuration error can give this error. In our case we had to set the video memory size manually to solve the problem..

To setup this :

- Boot Linux
- Press Ctrl+Shift+3
- Login as root
- enter - redhat-config-xfree86
- then you will get the display configuration window. There verify all the configurations
- Save your settings

This should do... it worked for us.

Own one is always the best

I clicked this picture in Wellawatte area, Colombo, Sri Lanka. Everyone believes that their vehicle is the best.