RE: [PHP] Requires and if statements problems, PLEASE HELP ME :)

From: Date: Fri, 03 Nov 2000 18:38:24 +0000
Subject: RE: [PHP] Requires and if statements problems, PLEASE HELP ME :)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-23618@lists.php.net to get a copy of this message
Hi Ade, > I have just moved my site to a new hosting company who are running PHP4 > where my old host was running PHP3 and i am having a strange problem, Here > it is: > > I am calling a php file which will detects & will show a no login > message if > it doens't detect a cookie to prove they are logged in like so, > else it will > move on to the else: statement. > > ----login_detect.php3---- > <? > if( !$cookie_variable ): > > require("top.php3"); > echo"NO LOGIN"; > require("bottom.php3"); > else: > ?> use include() instead of require()... You can't require inside a conditional. See the manual. Cheers, Matthias

« previous php.general (#23618) next »