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
rand() function
just a general question guys a girls, is the rand() function 100% random or is it based on time?
Problem with passing variables
I'm not really a php programmer so I'm really struggling with this issue. I have a banner script that is supposed to send people to an affiliate site and pass the parameters along with it.For
Linked Keywords
I am trying to get a script that makes my predefined keyword converted to links and / or converted to a certain color, size and so on... In one of the other threads Ive posted I got an answer I am a
j1inmis Ouput layout changes
Hi,
PHP & Java
Hello,can PHP code be used inside java code?Code: <SCRIPT LANGUAGE="JavaScript">OpenWindow.document.write("<?php echo NotWorking;
Greek characters in php
Hi,I'm making a script and I m using for first time greek characters.I started to write a simple drop down menu that loads some city names from the database. The names are in Greek in the database and
Contact Form Not Working When I Add Validation Codes
So I built my first working PHP "Contact Us" like form. But, I have been trying to now make the form Validate for empty fields when the user hits the submit button. Problem is when I added
data type in column definition
Hi,
Using insert variable
need a way to inert variable data to mysql database $acc = "212121212";$nok = "Nokia1100";$db_link = mysql_connect("localhost","root",
What am I missing here? Help!
Hello all!. I can't seem to get this working right. Well - it renders right, but something is going wrong. It's a set of filters for events. The filter marked "type" (category) works