Receive all the fields of a contact form in the mail
Hello gang,
I created a website including a contact form, which is essential.
URL : http://www.biosculpturegel-paca.fr/
In the demo file, there were only 4 fields. In mine, there are 9. These extra informations are for a client. Demo site : http://demo.cepreu.net/enfolio/
I edited the custom.js and ajax-functions.php to add these extra field in the code of tyhese documents. However, these new informations are nowhere to be seen in the mails I received via the contact form.
I started with PHP and Javascript like today so that's pretty new to me.
Could a good sould take a look at these short documents and tell me whats' wrong pretty please ? You would rock even more.
custom.js : custom.js
jquery.plugins.min.js (I didn't touch this one but maybe we should look inside it too) : jquery.plugins.min.js
index.html : index.html
I couldn't upload the ajax-functions.php file to my server and provide a proper URL so I'll paste the code here :
PHP Code:
<?php
$name = $_POST['name'];
$raison = $_POST['raison'];
$siret = $_POST['siret'];
$from = $_POST['email'];
$newsletter = $_POST['newsletter'];
$phone = $_POST['phone'];
$site = $_POST['site'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$to = 'contact@biosculpturegel-paca.fr'; // contact@biosculpturegel-paca.fr
$valid_referers = array(
'http://biosculpturegel-paca.fr/', // the URL to your page without www prefix
'http://www.biosculpturegel-paca.fr/' // the URL to your page with www prefix
);
$headers = 'From:' .$name. '<' .$from. ">\r\n" .
'Reply-To: '.$from."\r\n" .
'X-Mailer: PHP/' . phpversion();
if ($_SERVER['REQUEST_METHOD'] == 'POST' && in_array($_SERVER['HTTP_REFERER'], $valid_referers)) {
if (!mail($to, $subject, $message, $headers)) {
exit;
};
die('ok');
};
?>