Checkbox in an array

  • zbrdlowski
  • Beginner
  • Beginner
  • User avatar
  • Joined: Jan 10, 2006
  • Posts: 35
  • Loc: Trencin - Slovakia / Europe
  • Status: Offline

Post January 18th, 2010, 1:58 am

Okay, Try this:
in the part of the script which goes after form submitting put this:

$message = NULL;
if (empty($_POST['name_of_var'])) {
$variable_1 = FALSE;
$message .= '<p>Field Nr 1. is empty!</p>';
} else {
$variable_1 = $_POST['name_of_var'];
}

You can put as many of them as necessary. After that you gotta do simple check:

if ($variable_1 && $variable_2 && $variable_3 etc...)
{
put your script which process form values here
}
else {
print $message;
}
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post January 18th, 2010, 1:58 am

  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Joined: Jul 25, 2005
  • Posts: 2735
  • Loc: Nashville, TN
  • Status: Offline

Post January 18th, 2010, 6:35 am

zbrdlowski, the OP has reached a solution for the problem already. You can stop now. ;)
I'd love to change the world, but they won't give me the source code.
  • zbrdlowski
  • Beginner
  • Beginner
  • User avatar
  • Joined: Jan 10, 2006
  • Posts: 35
  • Loc: Trencin - Slovakia / Europe
  • Status: Offline

Post January 18th, 2010, 6:39 am

Okay... I just realized, there are many ways how to get the same result as he want... :D

Post Information

  • Total Posts in this topic: 18 posts
  • Users browsing this forum: No registered users and 147 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.