This site will look much better in a browser that supports web standards, but it is accessible to any browser or Internet device.


 

Dodo's Scripts Collection


Basic TutorialsBasic Tutorials

Echo and HTML
Sometimes you might find strange parse errors when you produce a php file. There are basically two ways to write html code in a php file. You may either print them outside of the <?php ?> or inside. If you wish to print them outside, you may do it just like in a regular html file.
<a href="http://regretless.com/scripts" target="_blank">
I love dodo's scripts</a>!!
<?php
// but if you want to print them inside of the php code
// you must do it with functions like echo or print
// and you MUST put backslashes (\) in front of all your
// quotation marks

echo "<a href=\"http://regretless.com/scripts\" target=\"_blank\">
I love dodo's scripts</a>";
?>
Look at test5.php. Why do you have to put backslashes? This is because whatever is inside of quotation marks is considered string - a type of variable in programming. If you want to put quoation marks inside of quotation marks and want them to be printed out, you must add an easy character so the computer doesn't get confused. When a computer gets confused, it will just spit out errors and quit on the code.
Back