I'm trying to send an email the contains html table data as well as the input from the user. This is what the email is displaying at the moment.
Device - iPad $14000
Your App Will Cost Approximately : $14000
FromEmail
The input from user is not being displayed for some odd reason, I've changed the function to .click & .form but this sends only the input from the user. I really want both of these things to send.
here is the html
<div class="total-inner">
<table class="total-table" id="table">
<tbody>
<tr>
<td>Device - iPad</td>
<td>$14000</td>
</tr>
</tbody>
</table>
<hr><br>
<div class="total-text-wrap">
<p>Your App Will Cost Approximately : $<span class="total">0</span></p>
</div>
<br><hr>
</div>
<div class="form-wrap">
<form method="post" class="quote-form" action="server.php">
<span>Company:<input type="text" name="name"></span>
<span>Email:<input type="text" name="email"></span>
<br>
<button class="total-button" id="send-quote" type="submit">SEND</button>
</form>
</div>
<div class="button-wrap">
<a href="index1.html">
<button class="total-button" input-type="submit">RESTART</button>
</a>
<button class="total-button" id="quote-advance">GET IN TOUCH</button>
<button class="total-button">SAVE PDF</button>
</div>
My Javascript/jquery
Var contactNode = $('#quote-advance'),
quoteNode = $('.quote-form'),
tableData = [],
totalData = [];
contactNode.click(function(){
$(".form-wrap").slideDown(750);
$(function(){
totalTableNode.each(function(){
tableData.push($(this).html());
});
totalText.each(function(){
totalData.push($(this).html());
});
quoteNode.submit(function(e){
$.ajax({
type : "POST",
url : 'server.php',
data : "content=" + tableData + totalData,
success: function(data) {
alert('Email Sent');// alert the data from the server
},
error : function() {
}
});
e.preventDefault();
});
});
});
and the php
<?php
$to = 'test@gmail.com';
$subject = 'Testing';
$message = $_REQUEST['content'];
$message .= 'From' . $_POST["name"];
$message .= 'Email' . $_POST["email"];
$headers = 'MIME-Version: 1.0' . "
";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "
";
mail($to, $subject, $message, $headers);
?>
To reiterate, the email that I'm receiving at the moment contains ONLY the html table data. & if i change the quoteNode function to .click or .form. The email sends the input data, but not the html table data & redirects to blank server.php file (I want it to alert & stay on the current page as well as send the user input & the html table data). Please help! I'm stumped!!! Cheers!