Page 1 of 1

Creating a PHP variable with Something

Posted: Tue Feb 12, 2008 9:55 pm
by jeff_md66
I've got a site with several pages on it and I want to yous a table to layout the site as if it were frames. ( I don't want to use frames because they are just to structured)

Ive got a simple site now

a top bar a links bar on the left

a body section in the middle for the actual text

and a bottom bar for a footer

My intention is to create a php (or other) script that will update a php variable based on the link that was click and display the page associated with that link


Lets say I have site1, site2 and site3

I've got

Link1, link2, and link3

When link1 is clicked I want site1 to be displayed in the body section of the site and the rest of the site not to change. the same could be said about site2 and site3

I thought about using javascript onclick but I don't believe I can update the php code with javascript.

<a href="link" onclick="<?php $body['variable']='variable'; ?>">Link</a><br />
<a href="link2" onclick="<?php $body['variable']='variable2'; ?>">Link2</a>


<?PHP Get valriable ?>

Any input would be great
thanks

Re: Creating a PHP variable with Something

Posted: Wed Feb 13, 2008 9:34 am
by Jonah Bron
You need ajax. AJAX will allow you to do this, though you will need the ajax to call on php pages.

http://www.google.com/search?sourceid=n ... x+tutorial

Oh, and you'll want a page like this:

Code: Select all

<html>
<head>
</head>
<body>
<table cellspacing="0" cellpadding="0" style="width:100%;height:100%">
<tr>
<td id="button_area">Links</td>
</tr>
<tr>
<td id="content area" style="overflow:scroll;">Main content</td>
</tr>
</table>
</body>
</html>
The overflow:scroll CSS property will make that area scroll