rabidityfactor Posted December 25, 2009 Share Posted December 25, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/186324-multiple-pages/ Share on other sites More sharing options...
russthebarber Posted December 25, 2009 Share Posted December 25, 2009 hi, i don't understand what the problem is with using 'include'. you will have no problem with your links using this method. Quote Link to comment https://forums.phpfreaks.com/topic/186324-multiple-pages/#findComment-983954 Share on other sites More sharing options...
jamesm6162 Posted December 25, 2009 Share Posted December 25, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/186324-multiple-pages/#findComment-983955 Share on other sites More sharing options...
ignace Posted December 25, 2009 Share Posted December 25, 2009 Option 5) Use the Two-Step View pattern of Martin Fowler (http://martinfowler.com/eaaCatalog/twoStepView.html) Quote Link to comment https://forums.phpfreaks.com/topic/186324-multiple-pages/#findComment-983967 Share on other sites More sharing options...
rabidityfactor Posted December 25, 2009 Author Share Posted December 25, 2009 Thankyou all for the quick replies. Quote Link to comment https://forums.phpfreaks.com/topic/186324-multiple-pages/#findComment-984010 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.