Jump to content

[SOLVED] Having a problem with carrying a variable over to an iframe.


JSHINER

Recommended Posts

<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?

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?

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.

<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.

 

 

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...........

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.