ItsWesYo Posted July 20, 2007 Share Posted July 20, 2007 I did this once before, but I forgot how. It's starting to aggravate me now =\ I can't really explain it, but if you look at the code below, you will probably get it. My problem is that it doesn't go to the page (?id=1§ion=1). guides.php <?php $page = $_REQUEST['id']; if($page == "1"){ echo (" guide #1 <a href='?id=1§ion=1'>part 1 of guide one</a> <a href='?id=1§ion=2'>part 2 of guide one</a> "); include ("http://1.itswesyo.hypreed.com/inc/footer.php"); die(); } elseif($page == "1§ion=1"){ echo (" guide #1, part 1 "); include ("http://1.itswesyo.hypreed.com/inc/footer.php"); die(); } else { echo (" the main guide page <a href='?id=1'>link to guide one</a> "); die(); } ?> Quote Link to comment Share on other sites More sharing options...
chigley Posted July 20, 2007 Share Posted July 20, 2007 // This: elseif($page == "1§ion=1"){ // Should be: elseif($page == "1" && $_GET["section"] = 1){ Also, can you include() external files? Quote Link to comment Share on other sites More sharing options...
lewis987 Posted July 20, 2007 Share Posted July 20, 2007 i dont really get it :S that code works 100% do you mean this? <?php $page = $_REQUEST['id']; $section = $_REQUEST['section']; if($page == "1"){ echo (" guide #1 <a href='?id=1§ion=1'>part 1 of guide one</a> <a href='?id=1§ion=2'>part 2 of guide one</a> "); include ("http://1.itswesyo.hypreed.com/inc/footer.php"); die(); } if($page == "1" && $section="1"){ echo (" guide #1, part 1 "); include ("http://1.itswesyo.hypreed.com/inc/footer.php"); die(); } } else { echo (" the main guide page <a href='?id=1'>link to guide one</a> "); die(); } ?> got beaten to it, but hey, that code will work Quote Link to comment Share on other sites More sharing options...
gerkintrigg Posted July 20, 2007 Share Posted July 20, 2007 you could use $_SERVER(DOCUMENT_ROOT) to find the path of the file that you need to send to. or just put the file name in the path? if you're referencing this as an include, do something like $page_name='index.php'; then change ?id=1 to index.php?id=1 hope this helps. Quote Link to comment Share on other sites More sharing options...
ItsWesYo Posted July 20, 2007 Author Share Posted July 20, 2007 Yeah, sorry. I was editing my post when you were in the topic =\ But thank you! Quote Link to comment Share on other sites More sharing options...
ItsWesYo Posted July 20, 2007 Author Share Posted July 20, 2007 Sorry for the double post, but I thought it worked =\ I used Lewis' code, but it didn't work =\ Quote Link to comment Share on other sites More sharing options...
lewis987 Posted July 20, 2007 Share Posted July 20, 2007 ok, i modified it again, here is the new code: <?php $page = $_REQUEST['id']; $section = $_GET['section']; if($_GET['id'] == "1"){ echo ("guide #1<br><a href='?id=1§ion=1'>part 1 of guide one</a><br><a href='?id=1§ion=2'>part 2 of guide one</a><br><br><br> "); include ("http://1.itswesyo.hypreed.com/inc/footer.php"); if(($_GET['id'] == "1") && ($_GET['section']=="1")){ echo (" guide #1, part 1 "); include ("http://1.itswesyo.hypreed.com/inc/footer.php"); } } else { echo (" the main guide page <a href='?id=1'>link to guide one</a> "); } ?> sorry, made some minor mistakes in it. That code uses $_GET rather than $_REQUEST, but you can change it Quote Link to comment Share on other sites More sharing options...
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.