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 Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.