PDA

View Full Version : Need Help With An If Statement for a Form


John_Saunders
11-23-2002, 08:42 PM
I'm using a form on my website and really need some help. What I would like to do is use the code below to print the form if it hasn't been submitted or if there's an error. If the form has been submitted and there hasn't been an error, I would like to hide the code between the tags below.

Can somebody tell me what needs to be changed in the code below? Right now it is printing the entire form whether it has or has not been submitted and when there is or is not an error.

<?php if (isset($error) || !isset($_POST['contact'])) { ?>

//form stuff here

<?php
}
?>

firepages
11-24-2002, 03:12 AM
you have to (in this case) seperate the 2 conditions in the if statement.


<?php if ((isset($error)) || (!isset($_POST['contact']))) { ?>
//etc
?>

John_Saunders
11-24-2002, 06:19 AM
THANK YOU firepages! I've spent a lot of time trying to figure out why it wasn't working. I really appreciate your help. :)


John