PHP beginner needs a little help

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 ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-23-2007
William Colls
 
Posts: n/a
Default PHP beginner needs a little help


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
Reply With Quote
  #2 (permalink)  
Old 12-23-2007
Olaf Schinkel
 
Posts: n/a
Default Re: PHP beginner needs a little help

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
Reply With Quote
  #3 (permalink)  
Old 12-24-2007
epicoxymoron@gmail.com
 
Posts: n/a
Default Re: PHP beginner needs a little help

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


Reply With Quote
  #4 (permalink)  
Old 01-07-2008
Peter Pei
 
Posts: n/a
Default Re: PHP beginner needs a little help

bad closing sequence of your ) and ".
Reply With Quote
  #5 (permalink)  
Old 01-07-2008
Peter Pei
 
Posts: n/a
Default Re: PHP beginner needs a little help

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...

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:09 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0