Skip to main content
Participant
August 3, 2009
Question

Please Help PHP email!!!

  • August 3, 2009
  • 2 replies
  • 967 views

HelloGuys

I am having a hard time getting my contact form to work via php, the problem is that whatever the customer puts in is not coming through to me only the field names please say you can help me

Here the codes

<?php>

/* Subject and Email Variables */
     
     $emailSubject = 'Speech Creative Inquires';
     $webMaster = 'emailname@mac.com';
    
/* Gathering Data Variables */

    $nameField = $_POST['fullname'];
     $companyField = $_POST['company'];
     $phoneField = $_POST['phone'];
     $emailField = $_POST['email'];
     $requestsField = $_POST['requests'];
    
     $body = <<<EOD
<br><hr><br>
Full Name: $fullname <br>
Company: $company <br>
Phone: $phone <br>
Email: $email <br>
Request: $requests <br>
EOD;

    $headers = "From: $email\r\n";
     $headers .= "Content-type: text/html\r\n";
     $success = mail($webMaster, $emailSubject, $body,
  $headers);
   
/* Results rendered as HTML */

    $theResults = <<<EOD
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Thank You from Speech Creative</title>
<style type="text/css">
<!--
body,td,th {
     color: #FFFFFF;
}
body {
     background-color: #000000;
     background-image: url(thanks.jpg);
     background-repeat: no-repeat;
}
.style4 {
     font-family: "Abadi MT Condensed Light";
     font-size: 24px;
}
-->
</style>
<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
   var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
   var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
     var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
     if (a.indexOf("#")!=0){ d.MM_p=new Image; d.MM_p[j++].src=a;}}
}

function MM_findObj(n, d) { //v4.01
   var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
     d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
   if(!(x=d)&&d.all) x=d.all; for (i=0;!x&&i<d.forms.length;i++) x=d.forms;
   for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
   if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
   var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
    if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p align="center" class="style4">Thank You for your interest in Speech Creative, We will respond as soon as possible</p>
<p align="center" class="style4"> </p>
<p align="center" class="style4"><a href="home.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('home','','homeoff.jpg',0)"><img src="homeon.jpg" alt="Homepage" name="home" width="103" height="62" border="0" id="home" /></a></p>
</body>
</html>
EOD;
echo "$theResults";
?>

This topic has been closed for replies.

2 replies

Participant
August 5, 2009

I'm having the exact same problem...we must have used the same video tutorial to code our form.

PLEASE let me know if you found the answer!

Inspiring
August 6, 2009

Not the way to learn PHP, but you can save yourself a lot of effortfor $99.00

see http://www.webassist.com/software/universal-email/

I use it all the time with no problems.

Howard WAlker

jon8
Inspiring
August 18, 2009

Go to my website for a DW extension for either php mail or pear mail/mail mime that automates the entire thing.  Just build any form with any form fields, and it will loop the lot and email to the addressed assigned.  Done deal in about 30 seconds.

DwFAQ
Participating Frequently
August 3, 2009

This question is asked frequently (daily) here in the forums. That said what trouble are you having that hasn't been answered in the many related discussions you've already searched for in this forum?