I've-yet-to-meet About 30 years ago, I wrote, in Commodore basic, a small arithmetic program for my children and have been trying to "replicate" it using html & php. Using this code it does what I want, when the file(test.php) is run in IE8, i.e. it displays the value of the variables (except the \r\n do not give a line break), Like so: What is 4 + 15? 4 + 15 = 19 However, this is not the case when the same code, including tags is inserted into an html page; below A web page
<body bgcolor="#fefee8">
<p><H1 align="center"> <font color="#00c630">Page header</font></H1> </p>
<HR> <!HR provides horizontal line below the TOPH>
</body>
<BR><!line break tag
</font> </br>
<body>
<P align="center"> <font color="#707070">
<div>
<?php
$a=rand (2, 20);
$b=rand (2, 20);
$c=$a+$b;
print "What is $a + $b? \r\n";
print " $a + $b = $c";
?>
</div>
</Body>
</html>
I am teaching myself the html and PHP as I go along, and have scoured the search engines for guidance but I cannot find much succour there, so appeal to you. My resources are Notepad++ as my editor, Apache as my localhost web server, and my guidebooks are SAMS Teach yourself PHP and IDG's Teach yourself HTML 4 (yes I know they are old). My hardware is Lenovo Thinkpad, Win XP (SP3) with IE8. It never was this difficult with Basic, (but the graphics sucked) :-), Any help is greatly appreciated.
` instead of `\r\n`. – Kami Mar 04 '14 at 17:16