Hello,
I have an iframe contained within a page whose source page includes a call to a function that accesses a $GET[] superglobal. is there some sort of "parent" function I need to call to have this var accessible to the iframe calling function? The iframe src page works without relying on variables i.e., the page is populated as expected with thumbnails, however, I need to separate which thumbnails are loaded based on the $GET[] var.
// iframe src - thumbs.php
<?
get_main_thumbs();
?>
// page containing iframe - portfolio.php
<div id="thumbs">
<iframe id="ifrm" name="ifrm" src="thumbs.php" scrolling="auto"
width="600" height="94" frameborder="0">
[Content for browsers that don't support iframes goes here.
Suggestion: include link to file specified in iframe src attribute.]
</iframe>
</div>
// function
function get_main_thumbs()
{
$projecttype = $_GET['pt'];
$dir = '../projects/' . $projecttype . '/';
echo $dir;
$files = scandir($dir);
foreach($files as $value) {
if(!in_array($value, array('.', '..'))) {
// check for folders
if(is_dir($dir.DIRECTORY_SEPARATOR.$value)) {
printf('<div class="thumb"><a href="portfolio.php?pt=%s&pn=%s" target="contents">'.
'<img src="' . $dir . $value . '/after/' . $value . '01.jpg" width="50" height="50" /></a></div>', $projecttype, urlencode($value));
}
}
}
}
Thanks,
Jason