<div class="form col-lg-5 col-lg-offset-1">
<form id="from-horizantal" action="" method="post" >
<div class="form-group">
<div class="col-lg-10 col-md-10 col-sm-10">
<input name="name" id="name" type="text" class="form-control" placeholder="Name">
</div>
</div>
<div class="form-group">
<div class="col-lg-10 col-md-10 col-sm-10">
<input name="email" id="email" type="email" class="form-control requiredField" placeholder="Email"
data-error-empty="Please enter your email" data-error-invalid="Invalid email address">
</div>
</div>
<div class="form-group">
<div class="col-lg-10 col-md-10 col-sm-10">
<textarea name="message" id="message" type="text" class="form-control" rows="3" placeholder="Your message"></textarea>
</div>
</div>
<div class="form-group">
<div class="col-lg-7 col-md-7 col-sm-7">
<div class="captcha">
<?php echo $code_1.' + '.$code_2 ?>
</div>
<input name="code" id="code" type="text" class="form-control col-lg-3 captcha-answer" placeholder="Captcha">
</div>
<input type="hidden" name="check" value="1" />
</div>
<div class="form-group">
<div class="col-lg-10 col-md-10 col-sm-10">
<button name="submit" id="submit" type="submit" class="btn btn-default form-control col-lg-10 col-md-10 col-sm-10" >Send</button>
</div>
</div>
</form>
</div>
<!---End form-->
<?php
if ($_POST['submit'] && (!$_POST['name'] || !$_POST['email'] || !$_POST['message'])) {
if (!$_POST['name']) {
echo "Please enter your name";
}
else {
if (!$_POST['email']) {
echo "Please enter your email";
}
else {
if (!$_POST['message']) {
echo "Please enter your message";
}
}
}
}
else {
}
?>
This is part of my index file and have Undefined index: submit error,
i want have a form contact and when the user click on the send btn form check the name & email & msg then if they exist save into my db,if they are not exist show the related error.
PS:i'm sorry about my english speaking & writing
Snapshot_2014-03-16_165215.png