I am designing a web page which loads other pages using an iframe. Now I want to pass $_GET[] args to each page but I am unable to do so. I think this is because of the iframe. Am I correct? Is there any way to use $_GET in iframes?
I am designing a web page which loads other pages using an iframe. Now I want to pass $_GET[] args to each page but I am unable to do so. I think this is because of the iframe. Am I correct? Is there any way to use $_GET in iframes?
You can use $_GET in the iframe as follows. All you need to do is call this function from the main page with parameters set.
Code:<iframe src="yourFrameUrl.php?name=<?php echo($_GET["name"]); ?>"></iframe>
Below code is the example how you use $_GET in iframes;
PHP Code:
<html>
<head> ........
</head>
<body>
<iframe id="showlistings" src="your_source" width="725" height="840" name="showlistings"></iframe>
<?php
$the_id = !empty($_GET["id"]) ? $_GET["id"] : "";
if(!empty($_GET["new"]))
{
echo "<script>
//Some statements
</script>";
}
?>
</body>
</html>
Bookmarks