Image

Imageremix_sakura wrote in Imagephp

URL encoding to set a variable

This is kind of a beginner question, but I am after all a beginner at PHP.

I have a site with an iframe layout, which of course when static can only show one file in the frame. I was thinking of using PHP to have the page display a different file in the frame depending on a $target variable. So I changed the iframe code in main.php4 to look like this:

<iframe src="
<?php echo $target; ?>
" name="content"></iframe>

And made the links in index.html look like this:

<a href="main.php4?target=1.html">Page 1</a>
<a href="main.php4?target=2.html">Page 2</a>

This was, of course, an effort to change which page main.php4 put in the iframe. But that URL encoding alone won't set the variable, and the frame just ends up empty. Or maybe I'm doing something else wrong. I'm quite unsure and haven't found any relevant information on this problem. So your input is appreciated to help the noobish one.