This is a discussion on PHP beginner needs a little help within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I am trying to build a script which wiil receive some user input, and submit the information via POST to ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I am trying to build a script which wiil receive some user input, and submit the information via POST to a second procedure, which does some validations. If the validations fail, the original procedure is recalled, but this time the user should see an error message. The following fragment illustrates: <html> <head> <title>Client Maintenance</title> </head> <body> <p><b>Add/Update a Client</b></p> <form action="clientmaint.php" method="post"> <?php if(isset($_POST['stts'])) { if($_POST['stts'] == "miss") { print("<p>You MUST provide at least a <b>telephone number</b><br>or a <b>surname</b></p>)"; } } ?> <SNIPPED SOME STUFF WHICH WOKS FINE> </form> </body> </html> What is actually happening is that everything from the "You" onward is being displayed by the client, on the first pass. So I'm getting on the client: Add/Update a Client You MUST provide at least a telephone number or a surname)"; } } ?> on the first pass, when the $_POST{'stts'] variable should not be set. I am sure this is a really simple problem for an expert. If any one can suggest how to get this to behave, I will be truely greatful, even unto half my kingdom (which if you really care amounts to about $0.50). Thanks all. Posted Via Usenet.com Premium Usenet Newsgroup Services ---------------------------------------------------------- ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY ** ---------------------------------------------------------- http://www.usenet.com |
|
|||
|
William Colls schrieb:
> > I am trying to build a script which wiil receive some user input, and > submit the information via POST to a second procedure, which does some > validations. If the validations fail, the original procedure is > recalled, but this time the user should see an error message. The > following fragment illustrates: > > <html> > <head> > <title>Client Maintenance</title> > </head> > <body> > <p><b>Add/Update a Client</b></p> > > <form action="clientmaint.php" method="post"> > > <?php > if(isset($_POST['stts'])) > { > if($_POST['stts'] == "miss") > { > print("<p>You MUST provide at least a <b>telephone number</b><br>or > a <b>surname</b></p>)"; > } > } > ?> > <SNIPPED SOME STUFF WHICH WOKS FINE> > </form> > </body> > </html> > > What is actually happening is that everything from the "You" onward is > being displayed by the client, on the first pass. So I'm getting on the > client: > > Add/Update a Client > > You MUST provide at least a telephone number > or a surname)"; } } ?> > > on the first pass, when the $_POST{'stts'] variable should not be set. > > I am sure this is a really simple problem for an expert. If any one can > suggest how to get this to behave, I will be truely greatful, even unto > half my kingdom (which if you really care amounts to about $0.50). > > Thanks all. > > Posted Via Usenet.com Premium Usenet Newsgroup Services > ---------------------------------------------------------- > ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY ** > ---------------------------------------------------------- > http://www.usenet.com You really posted the original Code? > You MUST provide at least a telephone number > or a surname)"; } } ?> This looks like some -> " oder ' <- Errors, or something. Exactly this: } } ?> is wondering me. Best Olaf |
|
|||
|
You close your parentheses before you close your quote
On Dec 23, 5:11 pm, William Colls <will...@procomsys.com> wrote: > I am trying to build a script which wiil receive some user input, and > submit the information via POST to a second procedure, which does some > validations. If the validations fail, the original procedure is > recalled, but this time the user should see an error message. The > following fragment illustrates: > > <html> > <head> > <title>Client Maintenance</title> > </head> > <body> > <p><b>Add/Update a Client</b></p> > > <form action="clientmaint.php" method="post"> > > <?php > if(isset($_POST['stts'])) > { > if($_POST['stts'] == "miss") > { > print("<p>You MUST provide at least a <b>telephone number</b><br>or > a <b>surname</b></p>)"; > }} > > ?> > <SNIPPED SOME STUFF WHICH WOKS FINE> > </form> > </body> > </html> > > What is actually happening is that everything from the "You" onward is > being displayed by the client, on the first pass. So I'm getting on the > client: > > Add/Update a Client > > You MUST provide at least a telephone number > or a surname)"; } } ?> > > on the first pass, when the $_POST{'stts'] variable should not be set. > > I am sure this is a really simple problem for an expert. If any one can > suggest how to get this to behave, I will be truely greatful, even unto > half my kingdom (which if you really care amounts to about $0.50). > > Thanks all. > > Posted Via Usenet.com Premium Usenet Newsgroup Services > ---------------------------------------------------------- > ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY ** > ---------------------------------------------------------- > http://www.usenet.com |