JSHINER Posted November 13, 2007 Share Posted November 13, 2007 <iframe src="http://www.site.com/page.php?id=000017" frameborder="0" scrolling="no" height="290" width="310"></iframe> I get the 000017 in there with a variable, and in the code it shows up correctly - but for some reason the iframe does not pull it up. Any idea why? Link to comment https://forums.phpfreaks.com/topic/77087-solved-having-a-problem-with-carrying-a-variable-over-to-an-iframe/ Share on other sites More sharing options...
btherl Posted November 13, 2007 Share Posted November 13, 2007 Do you see it in the HTML source when viewed in the browser? If so, it's a problem in your page.php script. FYI, your description is a little vague. What does "does not pull it up" mean? Do you see nothing in the iframe? Do you see the wrong content? Link to comment https://forums.phpfreaks.com/topic/77087-solved-having-a-problem-with-carrying-a-variable-over-to-an-iframe/#findComment-390391 Share on other sites More sharing options...
phpQuestioner Posted November 13, 2007 Share Posted November 13, 2007 Is your "id" variable defined and/or is your mysql accurate? Link to comment https://forums.phpfreaks.com/topic/77087-solved-having-a-problem-with-carrying-a-variable-over-to-an-iframe/#findComment-390394 Share on other sites More sharing options...
JSHINER Posted November 13, 2007 Author Share Posted November 13, 2007 Yes I see it in the HTML code - sorry for a vagueness $page['var'] = get($db, $_GET['id']); That's the code from the page. When I view the source of the iframe I only see page.php?id= - the id does not show up. Link to comment https://forums.phpfreaks.com/topic/77087-solved-having-a-problem-with-carrying-a-variable-over-to-an-iframe/#findComment-390397 Share on other sites More sharing options...
phpQuestioner Posted November 13, 2007 Share Posted November 13, 2007 try this: page.php?id=<?php echo $_GET['id']; ?> and see if that helps. use this if your pass the id with a string. Link to comment https://forums.phpfreaks.com/topic/77087-solved-having-a-problem-with-carrying-a-variable-over-to-an-iframe/#findComment-390399 Share on other sites More sharing options...
JSHINER Posted November 13, 2007 Author Share Posted November 13, 2007 It shows up fine the HTML code. Link to comment https://forums.phpfreaks.com/topic/77087-solved-having-a-problem-with-carrying-a-variable-over-to-an-iframe/#findComment-390400 Share on other sites More sharing options...
phpQuestioner Posted November 13, 2007 Share Posted November 13, 2007 is your mysql or sql correct Link to comment https://forums.phpfreaks.com/topic/77087-solved-having-a-problem-with-carrying-a-variable-over-to-an-iframe/#findComment-390404 Share on other sites More sharing options...
JSHINER Posted November 13, 2007 Author Share Posted November 13, 2007 Yes. As far as I know. When I call up the page outside the iframe it works fine with page.php?id=0017 Link to comment https://forums.phpfreaks.com/topic/77087-solved-having-a-problem-with-carrying-a-variable-over-to-an-iframe/#findComment-390405 Share on other sites More sharing options...
phpQuestioner Posted November 13, 2007 Share Posted November 13, 2007 is your frame target set? by this I am assuming you are pass the variable in a query string to your iframe - right? Link to comment https://forums.phpfreaks.com/topic/77087-solved-having-a-problem-with-carrying-a-variable-over-to-an-iframe/#findComment-390407 Share on other sites More sharing options...
JSHINER Posted November 13, 2007 Author Share Posted November 13, 2007 <iframe src="http://www.site.com/page.php?user=<?php echo $_SESSION['id']; ?>" frameborder="0" scrolling="no" height="290" width="310"></iframe> Which displays in the HTML as <iframe src="http://www.site.com/page.php?user=17" frameborder="0" scrolling="no" height="290" width="310"></iframe> But nothing comes up in the iframe. And when I go to http://www.site.com/page.php?user=17 the page comes up fine. Link to comment https://forums.phpfreaks.com/topic/77087-solved-having-a-problem-with-carrying-a-variable-over-to-an-iframe/#findComment-390410 Share on other sites More sharing options...
phpQuestioner Posted November 13, 2007 Share Posted November 13, 2007 do you have a url; I could test or code I can review? Link to comment https://forums.phpfreaks.com/topic/77087-solved-having-a-problem-with-carrying-a-variable-over-to-an-iframe/#findComment-390411 Share on other sites More sharing options...
JSHINER Posted November 13, 2007 Author Share Posted November 13, 2007 <?php function get($db, $id = false) { $arr = $db->getArray("SELECT . . . "); return $arr; } $db = new Database(); $page = array(); $page['id'] = get($db, $_GET['id']); $db->close(); ?> Link to comment https://forums.phpfreaks.com/topic/77087-solved-having-a-problem-with-carrying-a-variable-over-to-an-iframe/#findComment-390416 Share on other sites More sharing options...
phpQuestioner Posted November 13, 2007 Share Posted November 13, 2007 see if you can do this in one page: <iframe name="myframe" src="http://www.site.com/page.php" frameborder="0" scrolling="no" height="290" width="310"></iframe> <br><br> <a href="http://www.site.com/page.php?user=17" target="myframe">User 17 Wants In</a> just for testing purposes - see if this works........... Link to comment https://forums.phpfreaks.com/topic/77087-solved-having-a-problem-with-carrying-a-variable-over-to-an-iframe/#findComment-390418 Share on other sites More sharing options...
JSHINER Posted November 13, 2007 Author Share Posted November 13, 2007 That worked . Link to comment https://forums.phpfreaks.com/topic/77087-solved-having-a-problem-with-carrying-a-variable-over-to-an-iframe/#findComment-390421 Share on other sites More sharing options...
JSHINER Posted November 13, 2007 Author Share Posted November 13, 2007 Ok great I wasn't going crazy here - there was apparently another "id" on that page which conflicted with the second one. Changed to "ida" and it worked great. Sorry about that Long day. Link to comment https://forums.phpfreaks.com/topic/77087-solved-having-a-problem-with-carrying-a-variable-over-to-an-iframe/#findComment-390423 Share on other sites More sharing options...
phpQuestioner Posted November 13, 2007 Share Posted November 13, 2007 no worries - glad you figured it out - good luck Link to comment https://forums.phpfreaks.com/topic/77087-solved-having-a-problem-with-carrying-a-variable-over-to-an-iframe/#findComment-390427 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.