Yamaha32088 Posted March 16, 2008 Share Posted March 16, 2008 I am new to php/mysql. My website I am working on is www.marketlistads.com its just a template im modyfying but i first got to get the code to work. What im wondering is if there is a way to create something like a container that will reload anylink clicked on in it so that it doesnt reload the entire page and so I dont have to create 32 or more pages that are exactly the same just with the body being a little different. An example in case thats not clear enough is basically a left sided frame set I have never worked with Iframes or Framesets before but I have heard bad things about them. I want the user to be able to click on the links from the left navigation menu and not have to watch the entire page reload. Plus its a pain duplicating the same page over and over only to change a few pictures around. Anyhelp would greatly be appreciated. Quote Link to comment Share on other sites More sharing options...
ikmyer Posted March 16, 2008 Share Posted March 16, 2008 maybe create like a header file and a footer file... (header.php, footer.php) then on each page have... <?php include('header.php'); ?> body of page.... <?php include('footer.php'); ?> Then each page will have the same header/footer or whatever... throw in a menu.php or whatever you need. Quote Link to comment Share on other sites More sharing options...
roxki Posted March 17, 2008 Share Posted March 17, 2008 Use HTTP_GET_VARS? Link example: <a href="?page=Guestbook">My Guestbook</a> The page: <html><head><title>Your title</title></head><body> <?php if(!$_GET['page']) { echo "This is our front/home page.<br />"; } elseif($_GET['page'] == "Guestbook") { echo "Welcome to my Guestbookm feel free to read it and write in it!"; } ?> Quote Link to comment Share on other sites More sharing options...
redarrow Posted March 17, 2008 Share Posted March 17, 2008 You need to use the include() php function, But also you need to use css and maybe some html tables but you diffently need to use templates for each page needing the design................ Quote Link to comment Share on other sites More sharing options...
chmpdog Posted March 17, 2008 Share Posted March 17, 2008 This is really easy. Just make a folder called template and put your template in it as index.php: <html> all the styles and stuff <body> <php? content(); ?> </body> </html> Now make an includes folder and put in main.php and hompage.php and so on and so on(these are were your content goes): <?php content() { if(!$_GET['page']) { include('hompage.php') } elseif($_GET['page'] == "other") { include('otehr.php'); } } ?> Finally we will add the index page. So on your root put index.php: <php include('includes/main.php'); include('template/index.php'); ?> And thats that. Hope it helps. Caution: I wrote the code on the fly probably errors PS: visit my site Ravingredgames.com Quote Link to comment Share on other sites More sharing options...
Yamaha32088 Posted March 17, 2008 Author Share Posted March 17, 2008 THANK YOU SO MUCH FOR EVERYONES HELP worked perfect!!!!!!!!!!!!!! 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.