3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by cwarn23
0

If you are looking to change the content on the page dynamically (without reloading) then you should look into Javascript/AJAX for this.

0

Believe it or not this is just barley possible to do with php (and a little html). What you need to do is setup an iframe and make the link submit to the iframe with a url variable. Then when the iframe reloads, it gets the url variable and assigns it to a session variable making it available to the first page.

Below is the code for the page with the link (note that the very first thing the page starts with is the php code opening bracket:

<?
session_start();
$page=$_SESSION['page'];
?>
<iframe src='iframe.php' name='iframe' width='1' height='1' frameborder=0 scrolling='no'></iframe>
<a href='iframe.php?page=home.php' target='phpiframe'>Test Link</a>

Note that in the link, after the phrase "page=", it is then followed by what you want the $page variable to be. Now for the php iframe. So in the same folder, create a page named iframe.php and place in it the following code:

<?
session_start();
$_SESSION['page']=$_GET['page'];
?>

Now when you click the link it will return the "page=x" (in the link) as "$page=x". Just let me know if you need more info.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.