Jump to content

Multiple Pages


rabidityfactor

Recommended Posts

Hi. Im very new to php. I'm trying to create a basic login/registration page.

 

So I have a basic template (with headers and footers and stuff) - main.php. The contents are to be inside a table.

 

The login/registration pages(login.php, register.php etc) do not have any hearders/footers, and I want them to be inserted inside the table in main.php. I tried doing it with the @include('register.php'), but then these pages have links inside them, which opens separately.

 

How can I 'embed' the different pages in one single page - main.php?? I hope you understand my question.

 

Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/186324-multiple-pages/
Share on other sites

Option 1)

Use query string flags such as main.php?p=register

So each link redirects back to main.php, but the flag "p" indicates what is to be included in the table.

 

Option 2)

Use Ajax to load the entire register.php and just replace the contents of the table.

 

Option 3)

Include a standard layout on each page e.g.

include('header.php');
...rest of content
include('footer.php');

or using variables:

include('standard.php');
echo $header;
echo rest of content...
echo $footer;

 

Option 4)

Use Frames

Link to comment
https://forums.phpfreaks.com/topic/186324-multiple-pages/#findComment-983955
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.