PHP problem
| From: | Marion Heilbuth | Date: | Wed, 21 Aug 2002 08:53:42 +0000 |
| Subject: | PHP problem | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-12067@lists.php.net to get a copy of this message | ||
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.