weemikey Posted July 23, 2007 Share Posted July 23, 2007 Hey all. I did a search through the forum, but I can't find an answer for this question. I'm working on a site with another developer and he's got this piece of code to call an iframe. <?php echo ($_GET['iframe'] ? $_GET['iframe'] : '/home.php'); ?> The question is: what is the ":" between $_GET['iframe'] and '/home.php' doing? This WAS sorta working but it set "home.php" to show only the passed in frame. What I'm trying to do is take a url sent via an email and bring the user straight to a specific "activation" page. So the above code does that, but every time you click "home" on the menu, you go to the activation page instead of home.php. That's not what I want! So I created this little thing because it made more sense to have a test to see if the iframe value is being passed. This ONLY happens during activation, so it's a rare thing. <?php if (isset($_GET['iframe'])){ $iframe = $_GET['iframe']; echo $iframe; echo "<iframe src=\'".$iframe."'\" name=\"contentFrame\" id=\"contentFrame\" frameborder=\"0\" hspace=\"0\" vspace=\"0\" marginheight=\"0\" marginwidth=\"0\" scrolling=\"auto\" allowtransparency=\"yes\"></iframe>"; } else { echo "<iframe src=\"home.php\" name=\"contentFrame\" id=\"contentFrame\" frameborder=\"0\" hspace=\"0\" vspace=\"0\" marginheight=\"0\" marginwidth=\"0\" scrolling=\"auto\" allowtransparency=\"yes\"></iframe>"; } ?> I echo out the $iframe value and it's correct, but I get an error 404 saying the page can't be found. I don't do html and all that, so I'm a bit lost. Any help? It works fine if I don't pass in the iframe value. I do LOVE this place! Thanks, Mikey Link to comment https://forums.phpfreaks.com/topic/61439-solved-quick-question-on-iframes-sorry-double-post-disregard/ Share on other sites More sharing options...
AndyB Posted July 23, 2007 Share Posted July 23, 2007 ternary operator - http://php.codenewbie.com/articles/php/1480/The_Ternary_Operator-Page_1.html Link to comment https://forums.phpfreaks.com/topic/61439-solved-quick-question-on-iframes-sorry-double-post-disregard/#findComment-305781 Share on other sites More sharing options...
redarrow Posted July 23, 2007 Share Posted July 23, 2007 solved http://www.phpfreaks.com/forums/index.php/topic,151188.0.html Link to comment https://forums.phpfreaks.com/topic/61439-solved-quick-question-on-iframes-sorry-double-post-disregard/#findComment-305787 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.