For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > January 2008 > PHP beginner needs a little help









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author PHP beginner needs a little help
William Colls

2007-12-23, 7:00 pm


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
Olaf Schinkel

2007-12-23, 7:00 pm

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
epicoxymoron@gmail.com

2007-12-24, 4:00 am

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


Peter Pei

2008-01-07, 7:01 pm

bad closing sequence of your ) and ".
Peter Pei

2008-01-07, 7:01 pm

If you wonder whether he really posted his original code, you didn't see the
error. It was original and there is an issue around that "you" as he
mentioned...

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com