PHP Form Help
Posted: Wed Sep 08, 2010 1:37 am
I was hoping someone could help me out with my php form, I have 2 on my site one to request a quote (doesnt work) and on basic contact form (this one works). The quote form is not working because I tried to add more sections to it and I was trying to play with it to no avail. Here is the code and if anyone can send me to a good tutorial or help with code I would appreciate it.
And here is the HTML
Thanks again for all your help!
Code: Select all
<?php
// Contact subject
$subject ="$subject";
// Details
$message="
Name: $name\n
Company: $company\n
City/State: $city\n
Phone: $phone\n
Email: $customer_mail\n
Services Company Provides:\n
$products, $services, $charity\n
Website: $web\n
Services Needed:\n
$id\n, $bcd\n, $pd\n, $mm\n, $wd\n, $ec\n, $cms\n, $seo\n, $other\n, $otherservice\n
Project Description: $projdesc\n
Project Budget:$money\n
Additional Info: $add\n";
// Mail of sender
$mail_from="$customer_mail";
// From
$header="from: $name <$mail_from>";
// Enter your email address
$to ='derrickworkman@gmail.com';
$send_contact=mail($to,$subject,$message,$header);
// Check, if message sent to your email
// display message "We've recived your information"
if($send_contact){
echo "We've recived your contact information";
}
else {
echo "ERROR";
}
?>
Code: Select all
<form name="form1" method="post" action="send_request.php" class="paragraph_main">
Contact Info
<fieldset>
<p>
<label for="dummy0">Your Name:</label><br>
<input type="text" class="text" name="nameone" id="nameone" value="First, Last">
</p>
<p>
<label for="dummy1">Company:</label><br>
<input type="text" class="text" id="name" name="name" value="Company Name">
</p>
<p>
<label for="dummy2">City and State:</label><br>
<input type="text" class="text" id="city" name="city" value="City, State">
</p>
<p>
<label for="dummy3">Phone:</label><br>
<input type="text" class="text" id="phone" name="phone" value="Phone">
</p>
<p>
<label for="dummy4">E-Mail:</label><br>
<input type="text" class="text" id="customer_mail" name="customer_mail" value="Email Address">
</p>
</fieldset>
Company Info
<fieldset>
<p>
<label for="dummy5"><b>Services You Provide:</b></label><br>
<input type="checkbox" id="products" name="products" class="moveup2"> Products
<input type="checkbox" id="services" name="services" class="moveup2"> Services
<input type="checkbox" id="charity" name="charity" class="moveup2"> Charity
</p>
<p>
<label for="dummy6"><b>Business Description:</b></label><br>
<textarea id="businessdesc" name="businessdesc" rows="8" cols="25" ></textarea>
</p>
<p>
<label for="dummy7"><b>Current Website URL:</b> </label><br>
<input type="text" class="text" id="web" name="web" value="Leave Blank If You Do Not Have A Website">
</p>
</fieldset>
Project Details
<fieldset>
<p>
<label for="dummy8"><b>Services Needed:</b></label><br>
<input type="checkbox" id="ld" name="id" class="moveup2"> Logo Design<br />
<input type="checkbox" id="bcd" name="bcd" class="moveup2"> Business Card Design<br />
<input type="checkbox" id="pd" name="pd" class="moveup2"> Print Design<br />
<input type="checkbox" id="mm" name="mm" class="moveup2"> Marketing Material<br />
<input type="checkbox" id="wd" name="wd" class="moveup2"> Website Design<br />
<input type="checkbox" id="ec" name="ec" class="moveup2"> Website With Shopping Cart<br />
<input type="checkbox" id="cms" name="cms" class="moveup2"> CMS Website<br />
<input type="checkbox" id="seo" name="seo" class="moveup2"> SEO Opimization<br />
<input type="checkbox" id="other" name="other" class="moveup2"> Other: Specify Below<br />
<input type="text" class="text" id="otherservice" name="otherservice" value="Please List Any Other Services Needed:">
</p>
<p>
<label for="dummy9"><b>Project Description:</b></label>
<br>
<textarea id="projdesc" name="projdesc" rows="8" cols="25"></textarea>
</p>
<p>
<label for="dummy10">Project Budget:</label><br>
<select id="money" name="money">
<option value="1" >$300 - $600</option>
<option value="2" >$600 - $800</option>
<option value="3">$800 - $1000</option>
<option value="4">$1000 - $1500</option>
<option value="5" >$1500 - $2000</option>
<option value="6" >$2000 - $3000</option>
<option value="7" >$3000 - $4000</option>
</select>
</p>
<p>
<label for="dummy11"><b>Additional Information:</b></label>
<br>
<textarea id="add" name="add" rows="8" cols="25"></textarea>
</p>
</p>
</fieldset>
<p>
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Submit2" value="Reset">
</p>
</form>