Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
PHP script generates empty messages!
Old 01-17-2011, 08:46 AM PHP script generates empty messages!
Junior Talker

Posts: 1
Name: Karl Lind-Val
Trades: 0
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&ouml;r er fr&aring;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
karllindval is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-17-2011, 01:15 PM Re: PHP script generates empty messages!
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
What's the HTML of the form?
Never mind, saw the meta refresh (yuk). Only obvious thing I can see is the input field where name=name that's a no-no, change the value to my_name or whatever.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE

Last edited by PaulW; 01-17-2011 at 05:35 PM..
PaulW is online now
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP script generates empty messages!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.85426 seconds with 12 queries