Help with Contact Form
Posted on
16th Feb 2014 07:03 pm by
admin
I have this Form on an html page and the associated code on page.php (below).
I keep getting the "Please Fill In All Fields" message. Can you help me fix this?
I'm sure I'm just missing something. Thanks
Html page code:
Code: <form action="/page.php" method="post" name="contact_us" onSubmit="return capCheck(this);">
<table cellpadding="0" width="100%">
<tr>
<td width="10" class="required_field">*</td>
<td width="80">Your Name</td>
<td><input type="text" name="name" maxlength="50" style="width:300px" /></td>
</tr>
<tr>
<td class="required_field">*</td>
<td>Email Address</td>
<td><input type="text" name="email" maxlength="40" style="width:300px" /></td>
</tr>
<tr>
<td></td>
<td>Subject:</td>
<td><input type="text" name="subject" maxlength="40" style="width:300px" /></td>
</tr>
<tr>
<td></td>
<td>Comments:</td>
<td><textarea name="comments" style="width: 100%; height: 250px"></textarea></td>
</tr>
<tr>
<td class="required_field">*</td>
<td>Enter Image Code:</td>
<td><input type="text" value="" name="captext" style="width: 100px" maxlength="6" /></td>
</tr>
<tr>
<td></td>
<td><a onclick="refresh_security_image(); return false;" style="cursor:pointer;"><u>Refresh Image</u></a></td>
<td><img src="includes/captcha.php" border="0" id="verificiation_image" /></a></td>
</tr>
</table>
<p>
<input type="hidden" name="submited" value="1" />
<input type="submit" name="submit" value="Submit" />
</p>
</form>
PHP page code:
Code: //Start Contact Us
if($_POST['submited'] == "1"){
$your_email = "XXXXX"; //This is your email address
$from = "From: xxxxxx.com". "rn"; //This will show as the email sender.
$user_email = $_POST['email'];
$user_name = $_POST['name'];
$subject = $_POST['subject'];
$email_body = $_POST['comments'];
if($user_email == "" or $user_name == "" or $email_body == ""){
$error = "Please Fill In All Fields";
}else{
$message = "Feedback : n nUsers Email : $user_email nUsers Name : $user_name nnSubject : $subject nnn Comments : nn$email_body";
//SEND THE EMAIL
mail($your_email, $subject, $message, $from);
$result = "Your Message Has Been Sent. Thank You";
}
}
//End Contact Us
No comments posted yet
Your Answer:
Login to answer
76
14
Other forums
filesize() returns 0
I have a socket program that runs in an infinite loop, listening for connections, in this socket I h
set xml path in flash when xml created in memorystream and webrequest
i am creating an xml file using memory stream and i want to load this xml file into the flash on cli
Simple MySQL query...
Hello,
How could I do a mysql query that does this: SELECT * WHERE date/time < 5minutes ag
mysql_real_escape_string
Let me preface this that I am very much a PHP noob, but I have some SQL training (not necessarily My
If a record matches an existing record do nothing
So I don't know if I should put this here or in mysql, but what my script is for is for people to ad
Read from forum
Haven't written anything forever and I would like to get back.
What I'm trying to do is getting t
Getting the full city list from maxminds geoip database
I am suprised I can't find any references to this.
I have maxminds geoip lite installed and i
array & querys help/advice.
Ok so here goes , I have a mysql database and basically here's what I need to do.
// foreach
MVC - Code review
I'm in the process of trying to wrap my head around MVC, and as part of that, I'm attempting to impl
login box shows up again after logging in 2nd login works
Hello,
I am having trouble on my site Lockerz.rack111.com where when you login the login box