PDA

View Full Version : Simple web design problem



huggies15
August 29th, 2009, 11:43 PM
Hi all,
I'm just learning to build website and have run into a little problem. I have my page as i want it, but i want to have a section that changes when certain links are clicked on. I have the main 'links' section, but these are links within a section. How do i code it so when the link is pressed the data comes into that section only. ive added a screen shot of what i want to do below (done in gimp).
If anyone has any adivce, it will be greatful recieved.
Cheers,
Steve

http://img377.imageshack.us/img377/5879/cardiffchemistshowtoresq.jpg

hessiess
August 30th, 2009, 12:02 AM
Simplest way, use PHP to break the page into logical chunks with include statements, more maintainable way, find/write a CMS. Whatever you do, DO NOT use frames.

huggies15
August 30th, 2009, 12:08 AM
OK, well i only know how to write in html at the moment with <div> etc... i learnt frames dont look good on my previous attempt. CMS scares me as i dont really understand what it is that i does or how it works.
Can you do it with <div> so the data changes, or would it be easier to make a new page for each table i want to show and just link them the 'old skool' way?
Cheers

hessiess
August 30th, 2009, 01:04 AM
Can you do it with <div> so the data changes, or would it be easier to make a new page for each table i want to show and just link them the 'old school' way? Cheers

The only way to do this is to create separate pages, includes are just a way of removing the duplication of `common' content.

i.e. you would create separate pages for the changing elements, and include the common elements of the page.



<html>
<head></head>

<body>
<?php include("common.php"); ?>
<!-- changing element goes here -->
<?php include("footer.php"); ?>
</body>
</html>


Common.php could look something like this:



<div id="nav">
<!-- nav goes here -->
</div>

<div id="table" >
<!-- periodic table goes here -->
</div>


Footer.php would also be simmaler, just containing footer stuff.

huggies15
August 30th, 2009, 01:24 AM
OK, cheers.
Ill have a look at this php stuff soon. in the mean time ill just keep it with seperate pages.
Do u recommend any site other than w3schools for learing php?
Steve

hessiess
August 30th, 2009, 01:35 AM
http://devzone.zend.com/article/627-PHP-101-PHP-For-the-Absolute-Beginner