steve_683 Posted February 27, 2009 Share Posted February 27, 2009 This may be a novice question and I`m definitely a novice, So please excuse my unfamiliarity with the right terminology. I want to create 8-10 inter-linking `pages` that will show up in a 500px by 300px box on my website. Instead of actually creating 8-10 different pages, at different URLs, and having links between them, I would like to have this 500 by 300px box change it`s content depending on what links users click on (links that will themselves be within the box). Users will have options in how they navigate through these 8-10 different `pages` that apprear in the box. (That is, they won`t just display 1, then 2, then 3... all with the same exit. The user needs to be able to navigate around). Using a bunch of `if` and `else` statements just doesn`t cut it. I was almost tempted to try using a bunch of `goto` statements, but that`s probably a silly idea. There must be a better way! Quote Link to comment https://forums.phpfreaks.com/topic/147216-how-to-make-an-inter-linking-sequence-of-pages-run-from-the-same-url/ Share on other sites More sharing options...
Maq Posted February 27, 2009 Share Posted February 27, 2009 I want to create 8-10 inter-linking `pages` that will show up in a 500px by 300px box on my website. You need to either use an i-frame or AJAX. Iframe is more suitable for a novice. Using a bunch of `if` and `else` statements just doesn`t cut it. I was almost tempted to try using a bunch of `goto` statements, but that`s probably a silly idea. There must be a better way! A good solution, when implementing the i-frame approach, is to have each link look like this: iframe_link.php?page=1 iframe_link.php?page=2 iframe_link.php?page=3 //etc... Then your iframe code would look like: $page = $_GET['page']; switch ($page) { case 1: code to be executed for 1 break; case 2: code to be executed for 2; break; case 3: code to be executed for 3; break; default: if not 1, 2, or 3 do something else } You're going to have to look up exact syntax but I'm sure you get the idea. You should try it out and come back with specific questions. Again, this is just my opinion on a good solution for a novice, there are other ways if you don't like this approach. Quote Link to comment https://forums.phpfreaks.com/topic/147216-how-to-make-an-inter-linking-sequence-of-pages-run-from-the-same-url/#findComment-772840 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.