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(); } ?> Link to comment https://forums.phpfreaks.com/topic/60973-_request/ 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? Link to comment https://forums.phpfreaks.com/topic/60973-_request/#findComment-303398 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 Link to comment https://forums.phpfreaks.com/topic/60973-_request/#findComment-303399 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. Link to comment https://forums.phpfreaks.com/topic/60973-_request/#findComment-303401 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! Link to comment https://forums.phpfreaks.com/topic/60973-_request/#findComment-303403 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 =\ Link to comment https://forums.phpfreaks.com/topic/60973-_request/#findComment-303428 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 Link to comment https://forums.phpfreaks.com/topic/60973-_request/#findComment-303433 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.