// submits page with post silently with response needs 2nd page to work.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
var dog = $(this).attr("name"); // this can be anything // alert(dog); $.ajax({ type: 'POST', url: 'sendemail.php', data: ({ subject: dog, }), success: function(msg){ alert('Email Sent' + msg); } }); }); }); |
and the 2nd page (sendemail.php)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
<?php $first = $_POST['subject']; $last = $_POST['last']; $extention = $_POST['extention']; $hardware = $_POST['hardware']; $software = $_POST['software']; $description = "I want this from Ebay"; mail($Sendto,$description, "Name:$first $last Extention: $extention Hardware: $hardware Software: $software Description: $description","From: $email"); mail($email,$description, "We have received your email and we will contact you shortly","From: $Sendto" ); ?> I will email you about this soon. |