PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Mr Tech
Forum Contributor
Posts: 424 Joined: Tue Aug 10, 2004 3:08 am
Post
by Mr Tech » Thu Feb 24, 2005 6:23 pm
This is my code:
Code: Select all
<?php
if ($_POSTї'submit']) {
//check each customї] field
foreach($custom as $check) {
if ($check == "") {
$err = "yes";
}
}
if ($err) {
//display error
echo "Error";
} else {
//display thankyou page
echo "All fields entered";
}
} else {
?>
<form action="errorcheck.php" method="post">
<input type="text" name="customї1]"><br>
<input type="text" name="customї2]"><br>
<input type="text" name="customї3]"><br>
<input type="submit" name="submit" value="Submit">
</form>
<?php
}
?>
My only problem is register globals... I tried adding this:
Code: Select all
foreach($HTTP_GET_VARSїcustom] as $check) {
But I get an error. Can anyone shed some light on this?
Cheers.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Feb 24, 2005 7:20 pm
$_POST['custom']
Mr Tech
Forum Contributor
Posts: 424 Joined: Tue Aug 10, 2004 3:08 am
Post
by Mr Tech » Thu Feb 24, 2005 7:30 pm
LOL, I can't beleive I missed that. Cheers mate. I appreciate the help