Hi,
I have develop a quote form in php and after submission it will e-mail me all the inforamtion correctly but i have problem not getting the information from drop down list and also have browse field so user can upload this file if he wants.
PHP Code:
<?php
if(!$_POST) exit;
$email = $_POST['email'];
//$error[] = preg_match('/\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i', $_POST['email']) ? '' : 'INVALID EMAIL ADDRESS';
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email )){
$error.="Invalid email address entered";
$errors=1;
}
if($errors==1) echo $error;
else{
$values = array ('name','email','company','subject','message');
$required = array('name','email','company','subject','message');
$your_email = "kuhashmi@gmail.com";
$email_subject = "New Message: ".$_POST['subject'];
$email_content = "new message from contact page:\n";
foreach($values as $key => $value){
if(in_array($value,$required)){
if ($key != 'subject' && $key != 'company') {
if( empty($_POST[$value]) ) { echo 'PLEASE FILL IN REQUIRED FIELDS'; exit; }
}
$email_content .= $value.': '.$_POST[$value]."\n";
}
}
if(@mail($your_email,$email_subject,$email_content)) {
echo "Thanks for your enquiry we will contact you shortly have a nice day. Please check your spam folder also" ;
echo "<script type=\"text/javascript\">";
echo "setTimeout(function(){window.location=\"http://www.moghulweb.com/contact-us.html\"},2000);";
echo "</script>";
}
}
?>
HTML Code
<form action="Quote.php" method="post" class="wpcf7-form" novalidate>
<p>Your Name (required)<br />
<input id="name" name="name" class="text" /></p>
<p>Company Name (required)<br />
<input id="email" name="email" class="text" /> </p>
<p>E-mail Address<br />
<input id="company" name="company" class="text" /> </p>
<p>Budget<br />
<input id="subject" name="subject" class="text" /> </p>
<p>Nature of Business<br />
<input id="subject" name="subject" class="text" /> </p>
<p>Type of Website
<select name="type">
<option>PSD to HTML</option>
<option>PSD to WP</option>
<option>PSD to PHP</option>
</select></p>
<p>Number of Pages<br />
<input id="subject" name="subject" class="text" /> </p>
<p>Upload File -(jpg, PDF, DOC, gif)
<label for="file"></label>
<input type="file" name="file" id="file" /></p>
<p>Company Description<br />
<textarea id="message" name="message" cols="40" rows="10"></textarea> </p>
<p><input type="submit" value="SUBMIT" /></p>
<div ></div></form>
can't get value from Select and Browse field.
Thanks