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. 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 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! Link to comment https://forums.phpfreaks.com/topic/117755-solved-echo-html/#findComment-605675 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.