ItsWesYo Posted February 8, 2007 Share Posted February 8, 2007 I'm trying to make a guide for a site. I'll explain after I show the code: guides.php: <?php $page = $_REQUEST['id']; if($page == "1"){ include ("http://www.mysite.com/files/guide_newbie.php"); die(); } else { echo ( " <a href='?id=1'><b>Guide: Newbie</b></a> "); die(); } ?> Okay, basically: when someone visits 'guide.php', they come to that page of course. When they click the link on that page, they go to an included page called "guide_newbie.php" which is in a folder called "files". My problem is: On "guide_newbie.php", I have 'if statements' to divide sections up. I'm trying to make it look like this: id=1&sec=1 id would be the guide number included on "guides.php" sec would be the guide section of Guide #1. What I'm asking is, how do I do that? Link to comment https://forums.phpfreaks.com/topic/37636-passing-variables/ Share on other sites More sharing options...
papaface Posted February 8, 2007 Share Posted February 8, 2007 filename.php?id=1&sec=1 Link to comment https://forums.phpfreaks.com/topic/37636-passing-variables/#findComment-180028 Share on other sites More sharing options...
ItsWesYo Posted February 8, 2007 Author Share Posted February 8, 2007 yeah, i tried that and different combinations, but it wouldn't work. Link to comment https://forums.phpfreaks.com/topic/37636-passing-variables/#findComment-180029 Share on other sites More sharing options...
papaface Posted February 8, 2007 Share Posted February 8, 2007 can you paste some or all of guide_newbie.php Link to comment https://forums.phpfreaks.com/topic/37636-passing-variables/#findComment-180030 Share on other sites More sharing options...
ItsWesYo Posted February 8, 2007 Author Share Posted February 8, 2007 Here, I posted the whole thing this time. Some of the code might be sloppy because my friend wanted it done before last night, but I still screwed up. guides.php: <?php include ("http://www.1.projectwes.hyspex.com/includes/header.php"); $page = $_REQUEST['id']; if($page == "1"){ include ("http://www.1.projectwes.hyspex.com/files/guide_bbcode.php"); die(); } elseif($page == "2"){ include ("http://www.1.projectwes.hyspex.com/files/guide_games.php"); die(); } elseif($page == "3"){ include ("http://www.1.projectwes.hyspex.com/files/guide_newbie.php"); die(); } else { echo ( " <a href='?id=1'><b>Guide: BBCode</b></a><br> View forum codes to use on the discussion boards.<br><br> <a href='?id=2'><b>Guide: Games</b></a><br> View information and tips for all of the games.<br><br> <a href='?id=3'><b>Guide: Newbie</b></a><br> View our extensive newbie guide on all topics. "); die(); } include ("http://www.1.projectwes.hyspex.com/includes/footer.php"); ?> files/guide_newbie.php: (this is toooo long, so I posted the main part) <?php $page = $_REQUEST['id']; $menu = "1. <a href='?id=3&id=1'>Avatars</a><br> if($page == "1"){ echo ( " gfhgfhgfh " ); die(); } else { echo ( " fgfgdfgfd "); die(); } ?> Link to comment https://forums.phpfreaks.com/topic/37636-passing-variables/#findComment-180033 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.