PDA

View Full Version : whats the difference in these ??


Vinney
08-13-2002, 06:37 AM
if (!isset($mainfile)) { include("mainfile.php"); }
global $Pmenu,$breadcrumb;


and


include ("mainfile.php");
global $Pmenu,$breadcrumb;


whats is the purpose of having the different methods ?

mr e
08-13-2002, 06:55 PM
well the top one is just saying if $mainfile equals something, dont mess with it, but if it isn't set then make it equal something,

if (!isset($mainfile))

is just like saying "if $mainfile isn't set"

Ajay
08-18-2002, 09:13 PM
if (!isset($mainfile))

[/QUOTE]
if the '$mainfile' variable is set, then include mainfile.php


include ("mainfile.php");

this just includes the mainfile.php and doesnt check if the '$mainfile' variable is set