Re: PHP problem
| From: | Rasmus Lerdorf | Date: | Wed, 21 Aug 2002 12:16:59 +0000 |
| Subject: | Re: PHP problem | ||
| References: | 1 | Groups: | php.mirrors |
| Request: | Send a blank email to php-mirrors+get-12068@lists.php.net to get a copy of this message | ||
This is not the correct place to ask such questions. See the support link
on the web site.
[Edit your php.ini file and turn off E_NOTICE warnings if you don't want
to be warned about using variables that don't exist, or use an isset()
test: instead of just if($submit) use if(isset($submit)) or
if(!empty($submit)) ]
-Rasmus
On Wed, 21 Aug 2002, Marion Heilbuth wrote:
> Hello
> Why do I get
> "Undefined variable: submit in C:.......on line 7"
> "Undefined variable: submit in C:........on line 7"
> "Undefined variable: error in C:..........on line 29"
>
> When I run the following script?
>
> <html>
>
> <body>
>
> <?php
>
> if ($submit) {
>
> if (strlen($first) < 6 || strlen($last) < 6) {
>
> $error = "Sorry! You didn't fill in all the fields!";
>
> } else {
>
> // process form
>
> echo "Thank You!";
>
> }
>
>
>
> }
>
>
>
> if (!$submit || $error) {
>
> echo $error;
>
> ?>
>
> <P>
>
> <form method="post" action="<?php echo $PHP_SELF ?>">
>
> FIELD 1: <input type="text" name="first" value="<?php echo
> $first ?>">
>
> <br>
>
> FIELD 2: <input type="text" name="last" value="<?php echo
> $last ?>">
>
> <br>
>
> <input type="Submit" name="submit" value="Enter
> Information">
>
> </form>
>
> <?php
>
> } // end if
>
> ?>
>
>
>
> </body>
>
> </html>
>
>
>
>
>
>
>
> Marion Heilbuth|| EasyPay Administrator
>
> Physical Address - 3rd Floor Gerrits House; Belmont Office Park; 14 Belmont
> Road; Rondebosch; Western Cape; 7700; South Africa
> Postal Address - P.O. Box 58; Rondebosch; 7701; South Africa
>
> Email: marionh@prism.co.za || Website: www.prism.co.za
>
> | Disclaimer |
>
> This electronic mail contains privileged information intended only for the
> addressee(s). If you are not the/an intended recipient, you may not
> disclose, copy or in any way deal with or publish the contents thereof
> (including attachments), which is subject to copyright. If you have
> received this electronic mail in error, kindly notify the writer. Neither
> Prism Holdings Limited, its subsidiaries nor their employees accept any
> liability whatsoever as a result of any losses arising from persons placing
> reliance on any information contained in this message.
>
>
>
>
>
>
>