-
HTML in Echos
Right, does anyone know how to put html coding inside a php echo?
Im sure you can do it somehow but whenever i try, i get a parse error :(
Heres what im doing if you can help solve the problem
PHP Code:
<? echo("<img src="$logged[badge].gif">");?>
Thanks for any help :]
Edited by Lµke (Forum Moderator): Thread Moved from Website Designing. Please post in the correct section next time, Thanks :).
-
PHP Code:
<?php
echo("<img src=\"$logged[badge].gif\">");
?>
Add back slashes before "
-
-
Or use
PHP Code:
<?php echo 'Hello <a href="link.htm">Hi</a>';
but if you use a ' in the echo, you have to put
PHP Code:
<?php echo 'Hello <a href=\'link.htm\'>Hi</a>';
-
-
btw, If you are going to use any of my script up there make sure you add ?> at the end ty
-
BUT if you plan on echoing variables you need to use
PHP Code:
echo "<a href=\"page.php?id=$id\">Link</a>";