Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #9081
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: display two values on page |
| Date | 2013-04-18 09:08 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <kkor2a$tm2$1@dont-email.me> (permalink) |
| References | <e154c2d7-ccdf-4058-81d5-cbfbfec20264@googlegroups.com> |
In addition to what the others have said: On 4/18/2013 5:44 AM, newbie php wrote: <snip> $p=isset($_POST['price']) ? $_POST['price'] : 0; $n=isset($_POST['number']) ? $_POST['number'] : 0; The reason being - your page may be called from pages other than the form (i.e., someone typing the URL into the browser bar), in which case $_POST['price'] and $_POST['number'] won't be set. This code will set 0's into $p and $n should the values not be set. Better yet - don't put things like prices in hidden fields. It would be very easy for me to create a form on my own machine which sets a price of 1. You can display the price to the user, but keep critical values like this on the server. Remember - NOTHING from the user is ever safe and EVERYTHING needs to be validated. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ==================
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
display two values on page newbie php <s.hoitinga@gmail.com> - 2013-04-18 02:44 -0700
Re: display two values on page Tim Streater <timstreater@greenbee.net> - 2013-04-18 11:01 +0100
Re: display two values on page Christoph Becker <cmbecker69@gmx.de> - 2013-04-18 12:14 +0200
Re: display two values on page Tim Streater <timstreater@greenbee.net> - 2013-04-18 13:05 +0100
Re: display two values on page Paul Herber <paul@pherber.com> - 2013-04-18 11:12 +0100
Re: display two values on page Christoph Becker <cmbecker69@gmx.de> - 2013-04-18 12:18 +0200
Re: display two values on page newbie php <s.hoitinga@gmail.com> - 2013-04-18 03:22 -0700
Re: display two values on page Jerry Stuckle <jstucklex@attglobal.net> - 2013-04-18 09:08 -0400
Re: display two values on page Luuk <luuk@invalid.lan> - 2013-04-18 18:46 +0200
csiph-web