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