Jump to content

How to make an inter-linking sequence of pages run from the same URL?


Recommended Posts

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!

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.