nook6 Posted October 10, 2006 Share Posted October 10, 2006 HiThis may be a bit difficult to understand but i will try to explain it as best as i can.I am making my first php website and i have a header and footer page the links are in the header.i have my index page which just pulls external files (header.php mainpage.php and footer.php) what i want to know is if someone clicks one of the links at the top of the page can i change the mainpage.php to the page they want to look at so im using the one page just to pull in other external pages on my website?.I hope someone can understand what im talking about but if you have any problems just ask for the information you need and i will answer.Nook6Thanks in advance. Quote Link to comment Share on other sites More sharing options...
GremlinP1R Posted October 10, 2006 Share Posted October 10, 2006 Just to understand somthing here,Do you want the site to work like frames?Are you just including you one page on the other? Quote Link to comment Share on other sites More sharing options...
nook6 Posted October 10, 2006 Author Share Posted October 10, 2006 Hiyes im looking to have one page (index.php) that just calls the other parts (e.g. header and footer called at the top and bottom) then it calls whatever page by what link the person clicks so if the person clicks home page it calls index page and puts page one info into it if they call page 2 then it clls index.php and it puts page2.php info onto the page. the only other thing i can say is in html i used to do this with an iframe to load the pages and then i hade the links header and footer all staying the same and just the iframe changing the pages?i hope that helps a little more.Nook6 Quote Link to comment Share on other sites More sharing options...
GremlinP1R Posted October 10, 2006 Share Posted October 10, 2006 Okay well if you have all the links on the header.phpWhy not make your header the main page (index.php), so it will have all its info and include home.php and footer.php on that page. Then you can give your link a name lets say Page2 and set it as a form with action='' and method='post'. al you do from there is tel the system what to do.if (isset($_POST['page2'])){include('page2.php');}elseif (isset($_POST['page3'])){include('page3.php');}and so on and then just to make you home page as defaultelse {include('home.php');} Quote Link to comment Share on other sites More sharing options...
nook6 Posted October 10, 2006 Author Share Posted October 10, 2006 HiThanks very much i will try this.Nook6. Quote Link to comment Share on other sites More sharing options...
GremlinP1R Posted October 10, 2006 Share Posted October 10, 2006 Okay Sharp give a soud If you need some more help! Quote Link to comment Share on other sites More sharing options...
nook6 Posted October 10, 2006 Author Share Posted October 10, 2006 HiIm sorry im still having problems with this i know it is now my coding so here is the page with the coding on.This is index.php[code]<html><head></head><body bgcolor=black text=yellow><center><img src=images/banner.jpg><br><br><a href=index.php><img src=images/home.jpg border=0></a> <a href=games.php><img src=images/games.jpg border=0></a> <a href=wip.php><img src=images/wip.jpg border=0></a></center><?if (isset($_POST['games'])){include('games.php');}elseif (isset($_POST['wip'])){include('wip.php');}else {include('index.php');}?><? include('footer.php'); ?></body></html>[/code]This is the url to the page just in case you want to see whats happening[url=http://daves.servegame.com/website/]http://daves.servegame.com/website/[/url]This is just a simple page i put together to test this on so it isnt looking very good lol.Any help would be appreciatedthank youNook6 Quote Link to comment Share on other sites More sharing options...
GremlinP1R Posted October 10, 2006 Share Posted October 10, 2006 Okay wait, Your not using the include as you sould here.create your images into a button of a folder like your games image into a form.<form action"" name="games" methop="post"><input type="submit" name="games" value="<img src=images/games.jpg border=0>"></form>Then is should work fine.Okay not sure if that image in there will work, I'm not an webdeveloper only do PHP and MySQL for now.Brother do the designing and stuff. Quote Link to comment 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.