Re: php3 code does not work in php4
| From: | @ Edwin | Date: | Tue, 06 Aug 2002 16:41:56 +0000 |
| Subject: | Re: php3 code does not work in php4 | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-111398@lists.php.net to get a copy of this message | ||
Perhaps you can try fixing your HTML first and see what happens...
Like this portion: (quotes, etc.)
<INPUT type="text" name="quantity" size=10" maxlength = 10</p>
See if it works. If not, perhaps you can show us what's inside do_calculate.php.
Or, you can check the companion website of the book (if there is) and check for errata...
- E
Hello, May I begin by apologizing for the length of this post. I am brand new to PHP and I don't know what you might need to help me. So I included all I thought you might need. I hope someone can help me. I'm new (Day 2) at the study of PHP. I'm using a book named PHP ESSENTIALS by Meloni (writtten for PHP 3). Using an example in the PHP3 book (Chapter 2- 'Basic PHP Techniques') When I
SUBMIT, I received the PHP echo text following four error messages. The HTML form source follows: <HTML> <HEAD> <TITLE> BEAN COUNTER FORM </TITLE> </HEAD> <BODY> <FORM method = "POST" action="do_calculate.php"> <P>What is the price per bag? <INPUT TYPE ="text" name = "price" size = 10 maxlengh = 10></P> <P>How many bags would you like? <INPUT type="text" name="quantity" size=10" maxlength = 10</p> <INPUT type = "submit" value = "Submit"> </FORM> <BODY> </HTML> Here is the page resulting from the submit Notice: Undefined variable: price in C:\FREEDEV\XITAMI\webpages\do_calculate.php on line 26 line 26: $sub_total = $price * $quantity; Notice: Undefined variable: quantity in C:\FREEDEV\XITAMI\webpages\do_calculate.php on line 26 line 26: $sub_total = $price * $quantity; Notice: Undefined variable: price in C:\FREEDEV\XITAMI\webpages\do_calculate.php on line 34 line 34: $fmt_price = sprintf("%0.2f",$price); Notice: Undefined variable: quantity in C:\FREEDEV\XITAMI\webpages\do_calculate.php on line 42 line 42 echo "<P>You ordered $quantity bags of coffee.</p>"; In addition I modified PHP.ini as by adding the following lines. track_vars = on register_globals = on You ordered bags of coffee. Bags of coffee are $0.00 each. Your subtotal is $0.00. Sales tax is 8.25% in this location. $0.00 has been added to your order. You owe $0.00 for your coffee. Okay, that wasn't too bad, was it. Thanks Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php_________________________________________________________________ 会員登録は無料・充実した出品アイテムなら MSN オークション http://auction.msn.co.jp/