hippypink Posted November 17, 2009 Share Posted November 17, 2009 echo '<div id="thankyou_container" style=\\"text-align:left;padding:0px;\\"> <div id="container" style=\\"text-align:left;padding:0px;\\">' . ($_SESSION['iframe'] ? '<div id="logo_phone_menu"><img alt="logo" border="0" hspace="0" src="theme/' . $_SESSION['t'] . '/header.gif" vspace="0"/></div>' : ''); This code might have mistakes (since its not working). I realize that it is supposed to print some variables on to the page. But am new to PHP, and not sure about the question mark and colon thing. Any references to simple tutorials on this would be helpful too. thanks Quote Link to comment https://forums.phpfreaks.com/topic/181938-can-someone-explain-what-this-tiny-code-snippet-does/ Share on other sites More sharing options...
FaT3oYCG Posted November 17, 2009 Share Posted November 17, 2009 as it says it seems like a thankyou container for a website that contains an iframe which will display certain code depending on the value and if that value is not what it is supposed to be then it will display nothing. Quote Link to comment https://forums.phpfreaks.com/topic/181938-can-someone-explain-what-this-tiny-code-snippet-does/#findComment-959643 Share on other sites More sharing options...
oni-kun Posted November 17, 2009 Share Posted November 17, 2009 It uses ternary operators. But basically.. As far as I can see it echos a bit of HTML, which includes session variables. If they're logged in, then it displays the custom theme (note the absolute path). That code is messy and not really supposed to be done that way, PHP variables should be wrapped in HTML not echo'd and escaped so much like so. ? is a ternary operator. ; is a new line. Quote Link to comment https://forums.phpfreaks.com/topic/181938-can-someone-explain-what-this-tiny-code-snippet-does/#findComment-959644 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.