I have a form that is a calculates an estimate for the user.

<form method="post" action="php/pricing.php">
<table id="pasa"><tr>
<td>Number of Pages?</td><td><textarea name="pages" value="" rows="1" cols="5"/>
</textarea></td></tr></table>
Can You Provide the following content?<br>
<table id="pasa"><tr><td></td><td>Yes</td><td>Some</td><td> No</td></tr>
<tr><td>Pictures</td><td><input type="radio" name="pictures" value="0"></td>
<td><input type="radio" name="pictures" value="25" checked></td>
<td><input type="radio" name="pictures" value="50"></td></tr>

<tr><td>Literature</td><td><input type="radio" name="literatures" value="0"></td>
<td><input type="radio" name="literatures" value="50" checked></td>
<td><input type="radio" name="literatures" value="100"></td></tr></table>
<br>

Would you like us to add or Graphically Enhance any of the following?<br>
<table id="pasas">
<tr><td>Pictures</td><td><input type="checkbox" name="picture" value="50" ></td></tr>
<tr><td>Page</td><td><input type="checkbox" name="page" value="50" ></td></tr>
<tr><td>Contact Form</td><td><input type="checkbox" name="contact" value="100" ></td></tr>
</table><br>
<input type="submit" name="go" value="Calculate" />
</form>

Pricing.php

<html>
<body>
<?php
$pages=$_POST['pages'];
$pictures=$_POST['pictures'];
$literatures=$_POST['literatures'];
$picture=$_POST['picture'];
$page=$_POST['page'];
$contact=$_POST['contact'];
$pagecost=$pages*50;
$picturecost=$pages*$pictures;
$literaturecost=$pages*$literatures;
$pictureenhance=$pages*$picture;
$pageenhance=$pages*$page;
$total=$pagecost+$picturecost+$literaturecost+$pictureenhance+$pageenhance+$contact;

echo "<table>";
echo "<tr><td>Total</td><td> $total</td></tr> ";
echo "<tr><td>Pages</td><td> $pages</td></tr>";
echo "<tr><td>Pictures</td><td> $pictures </td></tr>";
echo "<tr><td>Literatures</td><td> $literatures </td></tr>";
echo "<tr><td>Picture Enhance</td><td> $picture </td></tr>";
echo "<tr><td>Page Enhance</td><td> $page </td></tr>";
echo "<tr><td>Contact Form</td><td> $contact </td></tr>";
echo "<tr><td>Page Cost</td><td> $pagecost </td></tr>";
echo "<tr><td>Picture Cost</td><td> $picturecost </td></tr>";
echo "<tr><td>Literature Cost</td><td> $literaturecost </td></tr>";
echo "<tr><td>Picture Enhance Cost</td><td> $pictureenhance </td></tr>";
echo "<tr><td>Page Enhance Cost</td><td> $pageenhance </td></tr>";
echo "</table>";
?>
</body>
</html>

What I want to add is a Form in pricing.php asking the user to provide contact information. Upon submit I want the an email to be sent to me with the users contact information and the estimate information. I know the mail function is this. mail($recipient, $subject, $msg); How would I integrate all of this? I'm starting to feel like i bit off more than i can chew.. lol

Recommended Answers

All 2 Replies

Now that you know the function, it should be easy. there are lots of example on how to use it. and maybe you can just put it after you insert the data to your DB.

Well the thing is i dont insert the estimates into a DB. Would using a DB be the only way?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.