Jump to content

[SOLVED] PHP help please. i must be an idiot?


stillkt1980

Recommended Posts

OK, guys... I wrote a very simple contact form script and it isn't working correctly.  It sends me the email, but the requested info is missing.  I'm new to scripting, so please be forgiving.  If someone could possibly point out my error, what would be great!  Thanks, guys!  Here's the code:

 

<?php

/* Subject and Email Variables */

$emailSubject = 'Keep Me Updated!';
$webMaster = 'updates@byevolution.com';

/* Gathering Data Variables */

$emailField = $_POST['email'];
$body = <<<EOD
<br><hr><br>
Email: $email <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>
<title>success</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="site_layout.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
#apDiv1 {
position:absolute;
width:306px;
height:38px;
z-index:1;
left: 479px;
top: 419px;
}
-->
</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>
<link href="success_layout.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('images/myspace.jpg','images/facebook.jpg','images/twitter.jpg')">
<!-- Save for Web Slices (success.psd) -->
<div id="site_layout">
  <table width="1200" height="601" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
    <tr>
      <td colspan="10">
        <img src="images/success_01.gif" width="1200" height="50" alt=""></td>
      </tr>
    <tr>
      <td colspan="10">
        <img src="images/logo.jpg" width="1200" height="221" alt="Begin You Evolution"></td>
      </tr>
    <tr>
      <td colspan="10">
        <img src="images/definition.gif" width="1200" height="92" alt=""></td>
      </tr>
    <tr>
      <td colspan="10">
        <img src="images/bar.gif" width="1200" height="50" alt=""></td>
      </tr>
    <tr>
      <td colspan="10">
        <img src="images/interest.gif" width="1200" height="67" alt=""></td>
      </tr>
    <tr>
      <td rowspan="3">
        <img src="images/follow.gif" width="424" height="120" alt=""></td>
      <td colspan="2">
        <img src="images/success_13.gif" width="27" height="80" alt=""></td>
      <td><a href="http://www.myspace.com/byevolution" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('myspacebtn','','images/myspace.jpg',1)"><img src="images/images/myspace.jpg" alt="Follow us on Myspace!" name="myspacebtn" width="73" height="80" border="0"></a></td>
      <td>
        <img src="images/success_15.gif" width="39" height="80" alt=""></td>
      <td><a href="http://www.facebook.com/home.php#/pages/BY-Evolution/112645499703?ref=ts" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('facebookbtn','','images/facebook.jpg',1)"><img src="images/images/facebook.jpg" alt="Follow us on Facebook!" name="facebookbtn" width="73" height="80" border="0"></a></td>
      <td>
        <img src="images/success_17.gif" width="39" height="80" alt=""></td>
      <td><a href="http://twitter.com/BYEvolution" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('twitterbtn','','images/twitter.jpg',1)"><img src="images/images/twitter_btn.jpg" alt="Follow us on Twitter!" name="twitterbtn" width="73" height="80" border="0"></a></td>
      <td>
        <img src="images/success_19.gif" width="56" height="80" alt=""></td>
      <td rowspan="3">
        <img src="images/comingsoon_09.gif" width="396" height="120" alt=""></td>
      </tr>
    <tr>
      <td rowspan="2">
        <img src="images/success_15-16.gif" width="1" height="40" alt=""></td>
      <td colspan="7">
        <img src="images/copyright_success.jpg" width="379" height="39" alt=""></td>
      </tr>
    <tr>
      <td colspan="7">
        <img src="images/success_17-18.gif" width="379" height="1" alt=""></td>
      </tr>
    <tr>
      <td>
        <img src="images/spacer.gif" width="424" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="26" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="73" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="39" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="73" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="39" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="73" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="56" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="396" height="1" alt=""></td>
      </tr>
  </table>
</div>
<!-- End Save for Web Slices -->
</body>
</html>
EOD;
echo "$theResults";

?>

 

 

 

[attachment deleted by admin]

Link to comment
Share on other sites

Look here

 

$emailField = $_POST['email'];

$body = <<<EOD

<br><hr><br>

Email: $email <br>

EOD;

 

You have $emailField set, but nowhere did you set $email. Try this

 

$emailField = $_POST['email'];

$body = <<<EOD

<br><hr><br>

Email: $emailField <br>

EOD;

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.