ngreenwood6 Posted August 1, 2008 Share Posted August 1, 2008 I am trying to use the echo command to put in some html code. I want something like this: echo "<a href="test.php">help</a>"; But I am not sure about how to properly insert the html code. I want to use this so I do not have to end the php then start html and then end the html and then start the php ( you get the idea). Any help is appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/117755-solved-echo-html/ Share on other sites More sharing options...
.josh Posted August 1, 2008 Share Posted August 1, 2008 <?php echo "<a href='test.php'>help</a>"; ?> php code needs to be wrapped in php tags and also your use of double quotes twice like that will confuse php so use single quotes inside the double quotes. Also the file extension (mime type) needs to be page.php or at least something recognized by your server to parse php scripts. And obviously you need to have the php parser installed. For longer pieces of html google HEREDOC Quote Link to comment https://forums.phpfreaks.com/topic/117755-solved-echo-html/#findComment-605663 Share on other sites More sharing options...
ngreenwood6 Posted August 1, 2008 Author Share Posted August 1, 2008 Thanks worked great! Quote Link to comment https://forums.phpfreaks.com/topic/117755-solved-echo-html/#findComment-605675 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.