porta325 Posted June 18, 2007 Share Posted June 18, 2007 <a href="http://www.site.com" target="_blank">title</a><br>description. I simply want to get this in browser but everything i get is a link.I don't want a link, i simply want that code in the browser.Anyone ? Thx!!! Link to comment https://forums.phpfreaks.com/topic/56099-echo-ing-code/ Share on other sites More sharing options...
Caesar Posted June 18, 2007 Share Posted June 18, 2007 Not sure what you're asking. Do you want to echo out actual code? Is that what you're asking? Link to comment https://forums.phpfreaks.com/topic/56099-echo-ing-code/#findComment-277063 Share on other sites More sharing options...
porta325 Posted June 18, 2007 Author Share Posted June 18, 2007 Yes, i want to echo a <a href= .... tag. Link to comment https://forums.phpfreaks.com/topic/56099-echo-ing-code/#findComment-277065 Share on other sites More sharing options...
ShoeLace1291 Posted June 18, 2007 Share Posted June 18, 2007 echo "<a href='url'>name</a>"; Link to comment https://forums.phpfreaks.com/topic/56099-echo-ing-code/#findComment-277068 Share on other sites More sharing options...
porta325 Posted June 18, 2007 Author Share Posted June 18, 2007 Not working, i have something like this echo "<a href=$url target="_blank">$title</a><br>$description"; Link to comment https://forums.phpfreaks.com/topic/56099-echo-ing-code/#findComment-277074 Share on other sites More sharing options...
Caesar Posted June 18, 2007 Share Posted June 18, 2007 If you want the html code to display as HTML....and not have it parse as HTML... <?php $string = '<a href="mypage.htm">My Page</a>"; $newstr = htmlentities($string); echo $newstr; ?> Link to comment https://forums.phpfreaks.com/topic/56099-echo-ing-code/#findComment-277078 Share on other sites More sharing options...
Caesar Posted June 18, 2007 Share Posted June 18, 2007 If you want the HTML to be parsed as HTML... <?php echo '<a href="mypage.htm">My Page</a>'; ?> Link to comment https://forums.phpfreaks.com/topic/56099-echo-ing-code/#findComment-277079 Share on other sites More sharing options...
porta325 Posted June 18, 2007 Author Share Posted June 18, 2007 I have to study this a little, the problem could be that i have 3 variables in that echo. Link to comment https://forums.phpfreaks.com/topic/56099-echo-ing-code/#findComment-277082 Share on other sites More sharing options...
DyslexicDog Posted June 18, 2007 Share Posted June 18, 2007 The problem wasn't in your php it was in your html. I believe you want to look into the <XMP> tag. I'm not really sure though as I've never used it before. Link to comment https://forums.phpfreaks.com/topic/56099-echo-ing-code/#findComment-277085 Share on other sites More sharing options...
porta325 Posted June 18, 2007 Author Share Posted June 18, 2007 I guess it's all about writing HTML inside PHP. I have to study a little bit more on how they combine. Link to comment https://forums.phpfreaks.com/topic/56099-echo-ing-code/#findComment-277087 Share on other sites More sharing options...
Corona4456 Posted June 18, 2007 Share Posted June 18, 2007 $htmlcode = htmlentities("<a href=$url target='_blank'>" . $title . "</a>" . $description); echo $htmlcode; Link to comment https://forums.phpfreaks.com/topic/56099-echo-ing-code/#findComment-277089 Share on other sites More sharing options...
porta325 Posted June 18, 2007 Author Share Posted June 18, 2007 I think i love you...Just kidding, anyway, that alooooooot. Link to comment https://forums.phpfreaks.com/topic/56099-echo-ing-code/#findComment-277093 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.