Assuming you can place php in the right spot on a page, the layout doesn't matter.
Here's the answer:
What you're talking about is called "GET". index.php?var=value.
To get GET values (heh), just use "$_GET['varname']".
This is ALL you need to do for what you're talking about.
1. Find your iframe tag.
2. Place the following code in it:
PHP Code:
<iframe src="http://path/<?php echo $_GET['frame']; ?>.html">
All that php does is "echoes" (outputs) whatever "?frame=this" is.
Change the path, .html, etc to your liking.
This will work with anything in the address bar.
However, the one catch is that if someone were to put "?frame=JSDFKL", then it would give an error... 404 in the frame.
You could have a code check if the page is valid. A bit more complex though.
Something like this:
PHP Code:
<?php
$url = $_GET['frame'].".html";
if (file_exists($url)) { $link = $url; }
else { $link = "default.html"; }
?>
And put:<? echo $url; ?> where you want the url to go (inside the iframe tag, after src="...
EDIT: Darn you, Twey... beat me to it.
Ha.
Same code, by the way, nekng. Use either... and use my second one if checking is important to you.
Bookmarks