chum Posted December 5, 2007 Share Posted December 5, 2007 I'm a bit confused, can you tell how i could place <?php ?> inside the <<< document? I put in like this, but the browser just spit it out as text, and doesn't run the code inside... if(isset($_GET['addjoke'])) {//Note : \x5B and \x5D is code for [ and ] character. $HTMLFORM = <<<JOKEFORM <form name="jokeForm" method="post" action="<?php echo $_SERVER\x5B'PHP_SELF'\x5D;?>"> <lable for="insertJoke">Please enter your joke here</lable><br /> <textarea name="insertJoke" cols="50" rows="15" ></textarea><br /> <input type="submit" value="ENTER"/> </form> JOKEFORM; echo $HTMLFORM; } Quote Link to comment Share on other sites More sharing options...
chum Posted December 5, 2007 Author Share Posted December 5, 2007 wtf, why move it here? gay... Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 5, 2007 Share Posted December 5, 2007 HEREDOC is a form of a quoted string. You can put PHP variables inside of it and they will be parsed and replace with their contents. You don't put PHP code inside of it. Quote Link to comment Share on other sites More sharing options...
chum Posted December 5, 2007 Author Share Posted December 5, 2007 it all makes sense now, thank you 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.