Chip,

I read all of the posts regarding this topic that I could find, and just 
*had* to reply.

(Take the TIME to look at this.  It is about the most Efficient, Powerful 
way I know of)

Do this!
__________________________________________________
<?php

    //If the hidden variable ACTION == DOIT then process the form
    //This way, the form will not get processed the first time around...
    if($ACTION=='DOIT')
    {
       //Validate Form Here
       if(empty($txtNAME)) $oErr->txtNAME="Required";
       if(empty($txtADDRESS)) $oErr->txtADDRESS="Required";

       //if there is an error message, break out here
       if(isset($oErr)) break;

       //Save your form here...

       //All went ok...  Redirect to the next page...
       header("Location: nextpage.php");
       exit;
    }

?>
<form name="frmMyForm" method="post" action="<?php echo $PHP_SELF; ?>">
    <input type="hidden" name="ACTION" value="DOIT">

    <?php echo($oErr->txtNAME); ?>
    <input type="text" name="txtNAME" value="<?php 
echo(htmlspecialchars($txtNAME));  ?>">

     *or*

    <?php1 if(isset($oErr->txtADDRESS)) echo($oErr->txtADDRESS); ?>
    <input type="text" name="txtADDRESS" value="<?php 
echo(htmlspecialchars($txtADDRESS));  ?>">

</form>
____________________________________________________________

-Jason Garber


At 03:49 PM 10/21/2001 -0400, Chip Landwehr wrote:
>I got a form that a user fills out.  When they hit submit they are
>transfered to a PHP page that verifies their data.  If a problem is found
>(They forgot to enter an e-mail address) the PHP sends them back to the
>original form with the field they forgot to fill out highlighted in red.
>Unfortunately all there entries are wiped out and they have to re-enter
>everything.  Any easy way to keep there original entries?
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to