Re: $c=$a+$b Simple Math
| From: | David Robley | Date: | Fri, 11 Aug 2000 07:40:58 +0000 |
| Subject: | Re: $c=$a+$b Simple Math | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-11278@lists.php.net to get a copy of this message | ||
On 10 Aug, Andrew V. Romero wrote:
> 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
This line above should be terminated with a semicolon
> 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.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA