Hey guys and dolls!
Im new to this website and i apologize if this problem has been discussed earlier.
The thing is I have made a relatively simple PHP based contact form and it works like a charm most of the times, BUT, the client I have built the site for gets like once a day a blank form response and they are afraid they are losing customers. I for one can't find anything wrong with the coding, so it should work, right? Would be really grateful if someone could take a look at it and have a look if Ive made a mistake! The text in the PHP script is in swedish if anyone wonders :P
PHP Code:
<?php
/* Subject & email */
$emailSubject = 'Bli kund förfrågan, Aros Home Consulting';
$webMaster = 'info@aroshomeconsulting.se';
/* Gathering */
$storstadningField = $_POST['storstadning'];
$storytaField = $_POST['storyta'];
$veckostadningField = $_POST['veckostadning'];
$veckoytaField = $_POST['veckoyta'];
$flyttstadningField = $_POST['flyttstadning'];
$flyttytaField = $_POST['flyttyta'];
$fonsterputsningField = $_POST['fonsterputsning'];
$antalfonsterField = $_POST['antalfonster'];
$byggstadningField = $_POST['byggstadning'];
$byggytaField = $_POST['byggyta'];
$kontorsstadningField = $_POST['kontorsstadning'];
$kontorytaField = $_POST['kontoryta'];
$trappstadningField = $_POST['trappstadning'];
$trappytaField = $_POST['trappyta'];
$byggstadning2Field = $_POST['byggstadning2'];
$byggyta2Field = $_POST['byggyta2'];
$ovrigtField = $_POST['ovrigt'];
$nameField = $_POST['name'];
$kontaktpersonField = $_POST['kontaktperson'];
$gatuadressField = $_POST['gatuadress'];
$postnummerField = $_POST['postnummer'];
$ortField = $_POST['ort'];
$phoneField = $_POST['phone'];
$mobileField = $_POST['mobile'];
$mailField = $_POST['mail'];
$choiceField = $_POST['choice'];
$body = <<<EOD
<br>
Privatperson/företag: $nameField <br>
Kontaktperson: $kontaktpersonField <br>
Adress: $gatuadressField <br>
Postadress: $ortField <br>
Postnummer: $postnummerField <br>
Email: $mailField <br>
Telefon: $phoneField <br>
Mobiltelefon: $mobileField <br>
Kund vill bli kontaktad via: $choiceField <br>
Övrig information: $ovrigtField <br>
<br>
Privatperson: <br>
Storstädning: $storstadningField på $storytaField kvm <br>
Veckostädning: $veckostadningField på $veckoytaField kvm <br>
Flyttstädning: $flyttstadningField på $flyttytaField kvm <br>
Fönsterputsning: $fonsterputsningField med $antalfonsterField st <br>
Byggstädning: $byggstadningField på $byggytaField kvm <br>
<br>
Företag: <br>
Kontorsstädning: $kontorsstadningField på $kontorytaField kvm <br>
Trappstädning: $trappstadningField på $trappytaField kvm <br>
Byggstädning: $byggstadningField på $byggytaField kvm <br>
EOD;
$headers = "From: $mailField\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);
/* Results */
$theResults = <<<EOD
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="refresh" content="3;URL=http://http://www.aroshomeconsulting.se/bli_kund_nu.html/">
<style type="text/css">
<!--
body {
background-color: #FFFFFF;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #666666;
text-decoration: none;
}
body p {
font-family: Tahoma, Geneva, sans-serif;
}
body p {
font-size: 16px;
}
body p {
color: #000;
}
-->
</style>
</head>
<div>
<div align="left">
<p><strong>Tack för er fråga!</strong></p>
<p>Vi kommer kontakta er inom kort!</p>
</div>
</div>
</body>
</html>
EOD;
echo "$theResults";
?>
Hope that you can help me! Again, it works, but not all of the time apperently :P
|