Jump to content

Recommended Posts

I was wondering if there was a way to include a bunch of pages in one.

Let me explain:

 

I start with the template of my site, and add pages using include(). In the page I include I want to have links to pages, that load in the same page.

It's hard to explain.

 

Page1 include()'s page2. I want page 2 to have links to page3, page4, and page5, but I want them to load in page2 when you click the links, instead of linking to a seperate page.

 

Can you help?

Link to comment
https://forums.phpfreaks.com/topic/53224-solved-help/
Share on other sites

ya do something along the lines with switch statements like this

<?php 
echo '<a href="index.php?page=test1>Link 1</a> - ';
echo '<a href="index.php?page=test2>Link 2</a> - ';
echo '<a href="index.php?page=test3>Link 3</a> - ';

switch($_GET['page']) {

case "test1":
include("file1.php");
break;
case "test2":
include("file2.php");
break;
case "test3":
include("file3.php");
break;

}
?>

Link to comment
https://forums.phpfreaks.com/topic/53224-solved-help/#findComment-262980
Share on other sites

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.