$c=$a+$b Simple Math
| From: | Andrew V. Romero | Date: | Fri, 11 Aug 2000 06:29:16 +0000 |
| Subject: | $c=$a+$b Simple Math | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-11267@lists.php.net to get a copy of this message | ||
I have been trying to get a simple math php script to work but can't
seem to make it work. Basically at this point I am trying to have a
user input two numbers into a html form at
http://www.u.arizona.edu/~avr/testing/form2.htm
and then I want a php
file to add those numbers and display the results. My php file is:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>test</title>
</head>
<body>
<?php
echo "Thanks for Testing <br>";
echo "X: $x <br>";
echo "Y: $y <br>";
$ans=$x+$y
echo "Answer: $ans <br>";
?>
</body> </html>
So why do I keep getting a "Parse error: parse error in
/home/u20/avr/public_html/testing/form2.php3 on line 12"? What do I
need to change in order to get it to display the results of x+y?
Thanks.
Remove the numbers from my address if you want to reply personally
--
Andrew V. Romero
Romer1999o@pharmacy.arizona.edu
Remove the #'s from my address to reply.
http://www.u.arizona.edu/~avr/
ICQ #54080914