KDM Posted June 12, 2011 Share Posted June 12, 2011 $head .= ' <form method="post" method="index2.php"> <div style="margin-bottom:10px; margin-top:20px; color:#FFFFFF">login <br /> <input class="inputfields" type="text" name="username" /> </div> <div style="margin-bottom:10px; color:#FFFFFF"> password <input class="inputfields" type="password" name="pwd" /> </div> <div><input type="submit" name="login" value="Login" /></div> </form>'; } $head .= $msg; $head .= '</div>'; $head .= ' These are all throughout my site. What does it mean? When I try to add a div I can't. What's the purpose of placing a div into the site by using $head.? Quote Link to comment https://forums.phpfreaks.com/topic/239114-please-explain-this-small-code-to-me/ Share on other sites More sharing options...
mikesta707 Posted June 12, 2011 Share Posted June 12, 2011 Um, this is kind of a broad question. The exact point of this code is unclear, as we never see what is done with the $head variable. However, what the code is doing is pretty easy to explain. first things first, this .= this is a compound operator, like += or -=, which basically means this $head .= "some string"; //the above is the same as $head = $head . "some string"; recall that the period (.) operator in PHP is the concatenation operator. Concatenation is basically adding two strings together. Now, the point of your code seems to be concatenating some HTML together. WHat happens to this html is unclear as you havent posted what your code does with $head Quote Link to comment https://forums.phpfreaks.com/topic/239114-please-explain-this-small-code-to-me/#findComment-1228567 Share on other sites More sharing options...
KDM Posted June 12, 2011 Author Share Posted June 12, 2011 I don't see $head doing anything. I have this in my code $page->addHtmlHead($addtohead); and this $addtohead = '<meta name="verify-v1" content="mYhKV6cVD/MPMg/1u49prydfyE4ksquDT6QbxhyLR78=" /> Quote Link to comment https://forums.phpfreaks.com/topic/239114-please-explain-this-small-code-to-me/#findComment-1228575 Share on other sites More sharing options...
mikesta707 Posted June 12, 2011 Share Posted June 12, 2011 well i dont know what your $page object is doing, but if I were to guess its simply adding content to the head tag of the html document Quote Link to comment https://forums.phpfreaks.com/topic/239114-please-explain-this-small-code-to-me/#findComment-1228577 Share on other sites More sharing options...
KDM Posted June 12, 2011 Author Share Posted June 12, 2011 ok i found this at the very bottom of my code $page->addHead($head); $page->addFoot($foot); Quote Link to comment https://forums.phpfreaks.com/topic/239114-please-explain-this-small-code-to-me/#findComment-1228584 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.