Avatar of mchyzik
mchyzikFlag for United States of America

asked on 

Web form not working correctly

I have a form on a website that the visitor fills out, then the information is to be sent via email to the owner of the site.  We get a bunch of junk.. not information from the form.  Below is a copy of what we receive in the email:

> To: glennnew@msn.com
> Subject: Feedback From Contact Form
> From: no_reply@newimagesphoto.com
> Date: Wed, 7 Jan 2009 12:08:33 -0600


> <html>

> <!-- Mirrored from www.newimagesphoto.com/contact/thankyou.html by HTTrack Website Copier/3.x [XR&CO'2007], Fri, 08 Aug 2008 15:25:07 GMT -->
> <head>
> <title>New Images Photography: Thank You</title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> <meta name="Description" content="New Images Photography, owned by Glenn G. New, has been Richmond's foremost wedding, corporate, architectural and commercial photography studio since 1975."> <meta name="keywords" content="Wedding Photography Wedding Photographers Professional Photographers Wedding Portraits Bridal Portraits Images Brides Bridal Weddings Corporate Architectural Commercial Richmond Virginia VA Va.">

> </head>

> <body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
> <br><br><br>
> <table border="0" align="center" cellpadding="0" cellspacing="0" width="286">
> <tr>
> <td width="286"><img src="images_contact/spacer.gif" width="286" height="20"><br>
> <font style='font: bold 17px/18px arial,helvetica,sans-serif; color:#cccc99'>Thank You</font><br><br>
> <font style='font: 12px/18px arial,helvetica,sans-serif; color:#cccc99'>Thank you for contacting New Images Photography. I will get back to you as soon as possible to arrange a time for us to meet. I look forward to working with you to capture and preserve the memories for your special event.</font><br><br>

> <a href="#" onclick="window.top.close(); return false"><img src=images_contact/btn-close.gif border="0"></a></td>
> </tr>
> </table>


> </body>

> <!-- Mirrored from www.newimagesphoto.com/contact/thankyou.html by HTTrack Website Copier/3.x [XR&CO'2007], Fri, 08 Aug 2008 15:25:07 GMT -->
> </html>


Here is a copy of the code for the form/page:
<html>
 
<!-- Mirrored from www.newimagesphoto.com/contact/form.php by HTTrack Website Copier/3.x [XR&CO'2007], Fri, 08 Aug 2008 15:25:01 GMT -->
 
<!-- Mirrored from www.newimagesphoto.com/contact/form.html by HTTrack Website Copier/3.x [XR&CO'2007], Tue, 21 Oct 2008 00:50:19 GMT -->
<head>
<title>New Images Photography: Contact</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Description" content="New Images Photography, owned by Glenn G. New, has been Richmond's foremost wedding, corporate, architectural and commercial photography studio since 1975."> <meta name="keywords" content="Wedding Photography Wedding Photographers Professional Photographers Wedding Portraits Bridal Portraits Images Brides Bridal Weddings Corporate Architectural Commercial Richmond Virginia VA Va.">
</head>
 
<body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="focus()">
 
<form name="form1" method="post" ACTION="http://www.newimagesphoto.com/contact/form.php">
<INPUT TYPE="hidden" NAME="mailto" VALUE="glennnew@msn.com">
<INPUT TYPE="hidden" NAME="subject" VALUE="Feedback From Contact Form">
<INPUT TYPE="hidden" NAME="htmlfile" VALUE="thankyou.html">
 
  <table border="0" align="center" width="585" cellpadding="0" cellspacing="0">
    <tr valign="top">
      <td width="129"><img src="images_contact/spacer.gif" width="129" height="16"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="5" height="1"></td>
      <td align="left" width="251">
        <img src="images_contact/spacer.gif" width="251" height="16"></td>
      <td rowspan="10"><img src="../images/logo_contact.gif"><br>
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/name.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="name" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/street.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="street" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/city.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="city" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/phone_1.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="home_phone" size="18">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/phone_2.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="work_phone" size="18">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/email.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="email" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/date.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <select name="date">
          <option selected>--</option>
          <option>01</option>
          <option>02</option>
          <option>03</option>
          <option>04</option>
          <option>05</option>
          <option>06</option>
          <option>07</option>
          <option>08</option>
          <option>09</option>
          <option>10</option>
          <option>11</option>
          <option>12</option>
        </select>
        <select name="select">
          <option selected>--</option>
          <option>01</option>
          <option>02</option>
          <option>03</option>
          <option>04</option>
          <option>05</option>
          <option>06</option>
          <option>07</option>
          <option>08</option>
          <option>09</option>
          <option>10</option>
          <option>11</option>
          <option>12</option>
          <option>13</option>
          <option>14</option>
          <option>15</option>
          <option>16</option>
          <option>17</option>
          <option>18</option>
          <option>19</option>
          <option>20</option>
          <option>21</option>
          <option>22</option>
          <option>23</option>
          <option>24</option>
          <option>25</option>
          <option>26</option>
          <option>27</option>
          <option>28</option>
          <option>29</option>
          <option>30</option>
          <option>31</option>
        </select>
        <select name="select2">
          <option selected>--</option>
          <option>2002</option>
          <option>2003</option>
          <option>2004</option>
          <option>2005</option>
        </select>
      </td>
    </tr>
    <tr valign="top">
      <td><img src="images_contact/wedding_location.gif" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left">
        <input type="text" name="wedding_location" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/rec_location.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left">
        <input type="text" name="reception_location" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129" align="left"><img src="images_contact/help.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" rowspan="2">
        <textarea name="comments" cols="27" rows="4" wrap="VIRTUAL"></textarea>
      </td>
      <td rowspan="2"> <img src="images_contact/spacer.gif" width="200" height="28">
        <input type="image" src=images_contact/submit.gif border="0" value="Submit" name="image">
        &nbsp;&nbsp;<a href="#" onClick="window.top.close(); return false"><img src=images_contact/cancel.gif border="0"></a>
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/spacer.gif" width="1" height="1"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="1"></td>
    </tr>
  </table>
</form>
</body>
 
<!-- Mirrored from www.newimagesphoto.com/contact/form.php by HTTrack Website Copier/3.x [XR&CO'2007], Fri, 08 Aug 2008 15:25:06 GMT -->
 
<!-- Mirrored from www.newimagesphoto.com/contact/form.html by HTTrack Website Copier/3.x [XR&CO'2007], Tue, 21 Oct 2008 00:50:22 GMT -->
</html>

Open in new window

Scripting LanguagesWeb Components

Avatar of undefined
Last Comment
mchyzik
Avatar of Loganathan Natarajan
Loganathan Natarajan
Flag of India image

what do you have written in form.php?
Post your server side process?
Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

Here is the form.php script:


<?php
 
if(isset($_POST['mailto']) && ($_POST['mailto']) != "")
{
        $Name = "www.newimagesphoto.com"; //senders name
        $email = "no_reply@newimagesphoto.com"; //senders e-mail adress
        $recipient = $_POST['mailto']; //recipient
 
        $myFile = "thankyou.html";
        $fh = fopen($myFile, 'r');
        $theData = fread($fh, filesize($myFile));
        fclose($fh);
 
        $mail_body = $theData; //mail body
        $subject = "Feedback From Contact Form"; //subject
 
        // To send HTML mail, the Content-type header must be set
        $headers  = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
 
        // Additional headers
        $header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields
 
        mail($recipient, $subject, $mail_body, $header); //mail command :)
 
            header("Location: " . $myFile );
}
?>
 
 
<html>
 
<!-- Mirrored from www.newimagesphoto.com/contact/form.php by HTTrack Website Copier/3.x [XR&CO'2007], Fri, 08 Aug 2008 15:25:01 GMT -->
<head>
<title>New Images Photography: Contact</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Description" content="New Images Photography, owned by Glenn G. New, has been Richmond's foremost wedding, corporate, architectural and commercial photography studio since 1975."> <meta name="keywords" content="Wedding Photography Wedding Photographers Professional Photographers Wedding Portraits Bridal Portraits Images Brides Bridal Weddings Corporate Architectural Commercial Richmond Virginia VA Va.">
</head>
 
<body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="focus()">
 
<form name="form1" method="post" ACTION="http://www.newimagesphoto.com/contact/form.php">
<!-- <INPUT TYPE="hidden" NAME="mailto" VALUE="glennnew@msn.com"> -->
<INPUT TYPE="hidden" NAME="mailto" VALUE="glennnew@msn.com">
<!--<INPUT TYPE="hidden" NAME="subject" VALUE="Feedback From Contact Form">-->
<!--<INPUT TYPE="hidden" NAME="htmlfile" VALUE="thankyou.html"> -->
 
  <table border="0" align="center" width="585" cellpadding="0" cellspacing="0">
    <tr valign="top">
      <td width="129"><img src="images_contact/spacer.gif" width="129" height="16"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="5" height="1"></td>
      <td align="left" width="251">
        <img src="images_contact/spacer.gif" width="251" height="16"></td>
      <td rowspan="10"><img src="../images/logo_contact.gif"><br>
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/name.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="name" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/street.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="street" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/city.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="city" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/phone_1.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="home_phone" size="18">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/phone_2.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="work_phone" size="18">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/email.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="email" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/date.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <select name="date">
          <option selected>--</option>
          <option>01</option>
          <option>02</option>
          <option>03</option>
          <option>04</option>
          <option>05</option>
          <option>06</option>
          <option>07</option>
          <option>08</option>
          <option>09</option>
          <option>10</option>
          <option>11</option>
          <option>12</option>
        </select>
        <select name="select">
          <option selected>--</option>
          <option>01</option>
          <option>02</option>
          <option>03</option>
          <option>04</option>
          <option>05</option>
          <option>06</option>
          <option>07</option>
          <option>08</option>
          <option>09</option>
          <option>10</option>
          <option>11</option>
          <option>12</option>
          <option>13</option>
          <option>14</option>
          <option>15</option>
          <option>16</option>
          <option>17</option>
          <option>18</option>
          <option>19</option>
          <option>20</option>
          <option>21</option>
          <option>22</option>
          <option>23</option>
          <option>24</option>
          <option>25</option>
          <option>26</option>
          <option>27</option>
          <option>28</option>
          <option>29</option>
          <option>30</option>
          <option>31</option>
        </select>
        <select name="select2">
          <option selected>--</option>
          <option>2002</option>
          <option>2003</option>
          <option>2004</option>
          <option>2005</option>
        </select>
      </td>
    </tr>
    <tr valign="top">
      <td><img src="images_contact/wedding_location.gif" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left">
        <input type="text" name="wedding_location" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/rec_location.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left">
        <input type="text" name="reception_location" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129" align="left"><img src="images_contact/help.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" rowspan="2">
        <textarea name="comments" cols="27" rows="4" wrap="VIRTUAL"></textarea>
      </td>
      <td rowspan="2"> <img src="images_contact/spacer.gif" width="200" height="28">
        <a href="#" onClick="this.form.submit();" ><input type="image" src=images_contact/submit.gif border="0" value="Submit" name="image"></a>
          <a href="#" onClick="window.top.close(); return false"><img src=images_contact/cancel.gif border="0"></a>
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/spacer.gif" width="1" height="1"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="1"></td>
    </tr>
  </table>
</form>
</body>
 
<!-- Mirrored from www.newimagesphoto.com/contact/form.php by HTTrack Website Copier/3.x [XR&CO'2007], Fri, 08 Aug 2008 15:25:06 GMT -->
</html>
 
Open in New Window Select All
Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

A little background on this site.. we had to copy it from their OLD host as they had dropped their hosting.  We picked it up a few months ago and this was the only way move their site to our server.
Then, you have to use phpmailer classes to do the above mailing.

ref.
http://phpmailer.codeworxtech.com/index.php?pg=examples
http://phpmailer.codeworxtech.com/index.php?pg=tutorial

example.html, you did not pass the values and replace it ... also, you need to print the dynamic values on the html design..


Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

can you tell me how do to what I need to do to get this working?  Im in desparation here :)
ok, wait plz
Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

goodmorning..
any suggestions on how to resolve the issue?  I would appreciate any assistance you can offer as I dont know/code php at all!  html I am ok with!  
Hi,

I am working now! wait for 10 mins
Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

that is fine ... I can wait for a few hours.. its only 7am here and I am off to my day job for 5 hrs.. :)
Hi,
Just try this,

Here is the CORRECTED form.php script

<?php
 
function mail_body($arr_mail)
{
	$message = "<html>
<body>
<table border='0' align='center' width='585' cellpadding='0' cellspacing='0'>
  <tr valign='top'>
    <td width='129'><img src='images_contact/spacer.gif' width='129' height='16'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='5' height='1'></td>
    <td align='left' width='251'><img src='images_contact/spacer.gif' width='251' height='16'></td>
    <td rowspan='10'><img src='../images/logo_contact.gif'><br>
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/name.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['name']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/street.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['street']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/city.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['city']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/phone_1.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['home_phone']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/phone_2.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['work_phone']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/email.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['email']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/date.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['date']."
    </td>
  </tr>
  <tr valign='top'>
    <td><img src='images_contact/wedding_location.gif' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left'>".$arr_mail['wedding_location']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/rec_location.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left'>".$arr_mail['reception_location']."
    </td>
  </tr>
  
  <tr valign='top'>
    <td width='129'><img src='images_contact/spacer.gif' width='1' height='1'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='1'></td>
  </tr>
</table>
</body></html>";
	
	return $message;
 
}
 
if(isset($_POST['mailto']) && ($_POST['mailto']) != "")
{
        $Name = "www.newimagesphoto.com"; //senders name
        $email = "no_reply@newimagesphoto.com"; //senders e-mail adress
        $recipient = $_POST['mailto']; //recipient
 		
		$arr_mail['name'] = $_POST['name'];
		$arr_mail['street'] = $_POST['street'];
		$arr_mail['home_phone'] = $_POST['home_phone'];
		$arr_mail['work_phone'] = $_POST['work_phone'];
		$arr_mail['email'] = $_POST['email'];
		$arr_mail['date'] = $_POST['date'];
		$arr_mail['wedding_location'] = $_POST['wedding_location'];
		$arr_mail['reception_location'] = $_POST['reception_location'];
		$arr_mail['comments'] = $_POST['comments'];
			
		
        $mail_body1 = mail_body($arr_mail); //mail body
        $subject = "Feedback From Contact Form"; //subject
 				
        // To send HTML mail, the Content-type header must be set
        $headers  = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
 
        // Additional headers
        $header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields
 
        mail($recipient, $subject, $mail_body, $header); //mail command :)
 
            header("Location: " . $myFile );
}
?>

Open in new window

Just replace this and work out...

still the date is not formatted properly.. i hope you can do that..
Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

that doesnt work at all.. take a look at the form now when you go to the site.. help please!

www.newimagesphoto.com  click on form and you get just a blank screen with your words..
Hi,

this works fine for me,

<?php
 
function mail_body($arr_mail)
{
	$message = "<html>
<body>
<table border='0' align='center' width='585' cellpadding='0' cellspacing='0'>
  <tr valign='top'>
    <td width='129'><img src='images_contact/spacer.gif' width='129' height='16'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='5' height='1'></td>
    <td align='left' width='251'><img src='images_contact/spacer.gif' width='251' height='16'></td>
    <td rowspan='10'><img src='../images/logo_contact.gif'><br>
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/name.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['name']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/street.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['street']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/city.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['city']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/phone_1.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['home_phone']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/phone_2.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['work_phone']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/email.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['email']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/date.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['date']."
    </td>
  </tr>
  <tr valign='top'>
    <td><img src='images_contact/wedding_location.gif' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left'>".$arr_mail['wedding_location']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/rec_location.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left'>".$arr_mail['reception_location']."
    </td>
  </tr>
  
  <tr valign='top'>
    <td width='129'><img src='images_contact/spacer.gif' width='1' height='1'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='1'></td>
  </tr>
</table>
</body></html>";
	
	return $message;
 
}
 
//isset($_POST['mailto']) && (
if(isset($_POST['mailto']) && ($_POST['mailto']) != "")
{
      
		$Name = "www.newimagesphoto.com"; //senders name
        $email = "no_reply@newimagesphoto.com"; //senders e-mail adress
        $recipient = $_POST['mailto']; //recipient
 		
		$arr_mail['name'] = $_POST['name'];
		$arr_mail['street'] = $_POST['street'];
		$arr_mail['home_phone'] = $_POST['home_phone'];
		$arr_mail['work_phone'] = $_POST['work_phone'];
		$arr_mail['email'] = $_POST['email'];
		$arr_mail['date'] = $_POST['date'];
		$arr_mail['wedding_location'] = $_POST['wedding_location'];
		$arr_mail['reception_location'] = $_POST['reception_location'];
		$arr_mail['comments'] = $_POST['comments'];
			
        $mail_body1 = mail_body($arr_mail); //mail body
        $subject = "Feedback From Contact Form"; //subject
		
		//echo $mail_body1;
		//exit;	 				
		
        // To send HTML mail, the Content-type header must be set
        $headers  = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
 
        // Additional headers
        $header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields
 
        mail($recipient, $subject, $mail_body, $header); //mail command :)
 
		echo "Mail is sent!";
        //    header("Location: " . $myFile );
}
 
 
 
 
?>
 
 
<html>
 
<!-- Mirrored from www.newimagesphoto.com/contact/form.php by HTTrack Website Copier/3.x [XR&CO'2007], Fri, 08 Aug 2008 15:25:01 GMT -->
<head>
<title>New Images Photography: Contact</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Description" content="New Images Photography, owned by Glenn G. New, has been Richmond's foremost wedding, corporate, architectural and commercial photography studio since 1975."> <meta name="keywords" content="Wedding Photography Wedding Photographers Professional Photographers Wedding Portraits Bridal Portraits Images Brides Bridal Weddings Corporate Architectural Commercial Richmond Virginia VA Va.">
</head>
 
<body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="focus()">
 
<form name="form1" method="post" ACTION="http://www.newimagesphoto.com/contact/form.php">
<!-- <INPUT TYPE="hidden" NAME="mailto" VALUE="glennnew@msn.com"> -->
<INPUT TYPE="hidden" NAME="mailto" VALUE="glennnew@msn.com">
<!--<INPUT TYPE="hidden" NAME="subject" VALUE="Feedback From Contact Form">-->
<!--<INPUT TYPE="hidden" NAME="htmlfile" VALUE="thankyou.html"> -->
 
  <table border="0" align="center" width="585" cellpadding="0" cellspacing="0">
    <tr valign="top">
      <td width="129"><img src="images_contact/spacer.gif" width="129" height="16"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="5" height="1"></td>
      <td align="left" width="251">
        <img src="images_contact/spacer.gif" width="251" height="16"></td>
      <td rowspan="10"><img src="../images/logo_contact.gif"><br>
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/name.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="name" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/street.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="street" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/city.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="city" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/phone_1.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="home_phone" size="18">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/phone_2.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="work_phone" size="18">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/email.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="email" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/date.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <select name="date">
          <option selected>--</option>
          <option>01</option>
          <option>02</option>
          <option>03</option>
          <option>04</option>
          <option>05</option>
          <option>06</option>
          <option>07</option>
          <option>08</option>
          <option>09</option>
          <option>10</option>
          <option>11</option>
          <option>12</option>
        </select>
        <select name="select">
          <option selected>--</option>
          <option>01</option>
          <option>02</option>
          <option>03</option>
          <option>04</option>
          <option>05</option>
          <option>06</option>
          <option>07</option>
          <option>08</option>
          <option>09</option>
          <option>10</option>
          <option>11</option>
          <option>12</option>
          <option>13</option>
          <option>14</option>
          <option>15</option>
          <option>16</option>
          <option>17</option>
          <option>18</option>
          <option>19</option>
          <option>20</option>
          <option>21</option>
          <option>22</option>
          <option>23</option>
          <option>24</option>
          <option>25</option>
          <option>26</option>
          <option>27</option>
          <option>28</option>
          <option>29</option>
          <option>30</option>
          <option>31</option>
        </select>
        <select name="select2">
          <option selected>--</option>
          <option>2002</option>
          <option>2003</option>
          <option>2004</option>
          <option>2005</option>
        </select>
      </td>
    </tr>
    <tr valign="top">
      <td><img src="images_contact/wedding_location.gif" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left">
        <input type="text" name="wedding_location" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/rec_location.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left">
        <input type="text" name="reception_location" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129" align="left"><img src="images_contact/help.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" rowspan="2">
        <textarea name="comments" cols="27" rows="4" wrap="VIRTUAL"></textarea>
      </td>
      <td rowspan="2"> <img src="images_contact/spacer.gif" width="200" height="28">
	 
        <a href="#" onClick="this.form.submit();" ><input type="image" src=images_contact/submit.gif border="0" value="Submit" name="image"></a>
          <a href="#" onClick="window.top.close(); return false"><img src=images_contact/cancel.gif border="0"></a>
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/spacer.gif" width="1" height="1"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="1"></td>
    </tr>
  </table>
</form>
</body>

Open in new window

did you try out?
Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

just tried it out.. the form comes up now.. but I didnt get the 'thank you form' upon submission... and am waiting for the email (of the form) from the site..
Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

I received the 'feedback' form but it is COMPLETELY BLANK.. none of the data entered is there..
I modified the script to reflect current years.. and added my email addy to it so I would get the form.. but all I get is a blank form.  Help please...
Can you echo it the message before you send  as email?

It works fine to me!

echo $mail_body1;
exit;	 

Open in new window

Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

what do you want me to do? Put that code in the beginning? (to echo)...
The form doesnt prompt to send an email.. you just enter the info and hit send... NOTHING comes up, nor should it but a 'thank you' popup that does not come up now either.  The email is transparant to the user....
Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

could someone please help.. customer is really getting out of sorts.  I just received another 'blank' email from the form.  Is there something else I can do to change this.. perhaps not have the form but let it come up with 'email' for them to notify me?  Suggestions?  I just need it fixed please.. please, please.
Hi,

Please do attach both files code again, let me check it
Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

here are the files.
Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

I w/have to cut/paste code here.. as it wont let me upload the files.. any other suggestions?
Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

FORM CODE:

<?php
 
function mail_body($arr_mail)
{
      $message = "<html>
<body>
<table border='0' align='center' width='585' cellpadding='0' cellspacing='0'>
  <tr valign='top'>
    <td width='129'><img src='images_contact/spacer.gif' width='129' height='16'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='5' height='1'></td>
    <td align='left' width='251'><img src='images_contact/spacer.gif' width='251' height='16'></td>
    <td rowspan='10'><img src='../images/logo_contact.gif'><br>
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/name.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['name']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/street.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['street']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/city.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['city']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/phone_1.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['home_phone']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/phone_2.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['work_phone']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/email.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['email']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/date.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['date']."
    </td>
  </tr>
  <tr valign='top'>
    <td><img src='images_contact/wedding_location.gif' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left'>".$arr_mail['wedding_location']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/rec_location.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left'>".$arr_mail['reception_location']."
    </td>
  </tr>
 
  <tr valign='top'>
    <td width='129'><img src='images_contact/spacer.gif' width='1' height='1'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='1'></td>
  </tr>
</table>
</body></html>";
      
      return $message;
 
}
 
//isset($_POST['mailto']) && (
if(isset($_POST['mailto']) && ($_POST['mailto']) != "")
{
     
            $Name = "www.newimagesphoto.com"; //senders name
        $email = "no_reply@newimagesphoto.com"; //senders e-mail adress
        $recipient = $_POST['mailto']; //recipient
             
            $arr_mail['name'] = $_POST['name'];
            $arr_mail['street'] = $_POST['street'];
            $arr_mail['home_phone'] = $_POST['home_phone'];
            $arr_mail['work_phone'] = $_POST['work_phone'];
            $arr_mail['email'] = $_POST['email'];
            $arr_mail['date'] = $_POST['date'];
            $arr_mail['wedding_location'] = $_POST['wedding_location'];
            $arr_mail['reception_location'] = $_POST['reception_location'];
            $arr_mail['comments'] = $_POST['comments'];
                  
        $mail_body1 = mail_body($arr_mail); //mail body
        $subject = "Feedback From Contact Form"; //subject
            
            //echo $mail_body1;
            //exit;                               
            
        // To send HTML mail, the Content-type header must be set
        $headers  = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
 
        // Additional headers
        $header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields
 
        mail($recipient, $subject, $mail_body, $header); //mail command :)
 
            echo "Mail is sent!";
        //    header("Location: " . $myFile );
}
 
 
 
 
?>
 
 
<html>
 
<!-- Mirrored from www.newimagesphoto.com/contact/form.php by HTTrack Website Copier/3.x [XR&CO'2007], Fri, 08 Aug 2008 15:25:01 GMT -->
<head>
<title>New Images Photography: Contact</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Description" content="New Images Photography, owned by Glenn G. New, has been Richmond's foremost wedding, corporate, architectural and commercial photography studio since 1975."> <meta name="keywords" content="Wedding Photography Wedding Photographers Professional Photographers Wedding Portraits Bridal Portraits Images Brides Bridal Weddings Corporate Architectural Commercial Richmond Virginia VA Va.">
</head>
 
<body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="focus()">
 
<form name="form1" method="post" ACTION="http://www.newimagesphoto.com/contact/form.php">
<!-- <INPUT TYPE="hidden" NAME="mailto" VALUE="glennnew@msn.com"> -->
<!-- <INPUT TYPE="hidden" NAME="mailto" VALUE="glennnew@msn.com"> -->
<INPUT TYPE="hidden" NAME="mailto" VALUE="mchyzik@compu-wizard.com">
<INPUT TYPE="hidden" NAME="subject" VALUE="Feedback From Contact Form">
<!--<INPUT TYPE="hidden" NAME="htmlfile" VALUE="thankyou.html"> -->
<INPUT TYPE="hidden" NAME="htmlfile" VALUE="thankyou.html">
 
  <table border="0" align="center" width="585" cellpadding="0" cellspacing="0">
    <tr valign="top">
      <td width="129"><img src="images_contact/spacer.gif" width="129" height="16"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="5" height="1"></td>
      <td align="left" width="251">
        <img src="images_contact/spacer.gif" width="251" height="16"></td>
      <td rowspan="10"><img src="../images/logo_contact.gif"><br>
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/name.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="name" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/street.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="street" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/city.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="city" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/phone_1.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="home_phone" size="18">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/phone_2.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="work_phone" size="18">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/email.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <input type="text" name="email" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/date.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" width="251">
        <select name="date">
          <option selected>--</option>
          <option>01</option>
          <option>02</option>
          <option>03</option>
          <option>04</option>
          <option>05</option>
          <option>06</option>
          <option>07</option>
          <option>08</option>
          <option>09</option>
          <option>10</option>
          <option>11</option>
          <option>12</option>
        </select>
        <select name="select">
          <option selected>--</option>
          <option>01</option>
          <option>02</option>
          <option>03</option>
          <option>04</option>
          <option>05</option>
          <option>06</option>
          <option>07</option>
          <option>08</option>
          <option>09</option>
          <option>10</option>
          <option>11</option>
          <option>12</option>
          <option>13</option>
          <option>14</option>
          <option>15</option>
          <option>16</option>
          <option>17</option>
          <option>18</option>
          <option>19</option>
          <option>20</option>
          <option>21</option>
          <option>22</option>
          <option>23</option>
          <option>24</option>
          <option>25</option>
          <option>26</option>
          <option>27</option>
          <option>28</option>
          <option>29</option>
          <option>30</option>
          <option>31</option>
        </select>
        <select name="select2">
          <option selected>--</option>
          <option>2009</option>
          <option>2010</option>
          <option>2011</option>
          <option>2012</option>
        </select>
      </td>
    </tr>
    <tr valign="top">
      <td><img src="images_contact/wedding_location.gif" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left">
        <input type="text" name="wedding_location" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/rec_location.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left">
        <input type="text" name="reception_location" size="25">
      </td>
    </tr>
    <tr valign="top">
      <td width="129" align="left"><img src="images_contact/help.gif" width="129" height="23"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="30"></td>
      <td align="left" rowspan="2">
        <textarea name="comments" cols="27" rows="4" wrap="VIRTUAL"></textarea>
      </td>
      <td rowspan="2"> <img src="images_contact/spacer.gif" width="200" height="28">
      
        <a href="#" onClick="this.form.submit();" ><input type="image" src=images_contact/submit.gif border="0" value="Submit" name="image"></a>
          <a href="#" onClick="window.top.close(); return false"><img src=images_contact/cancel.gif border="0"></a>
      </td>
    </tr>
    <tr valign="top">
      <td width="129"><img src="images_contact/spacer.gif" width="1" height="1"></td>
      <td align="left"><img src="images_contact/spacer.gif" width="1" height="1"></td>
    </tr>
  </table>
</form>
</body>
Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

THANK YOU CODE:

<html>

<head>
<title>New Images Photography: Thank You</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Description" content="New Images Photography, owned by Glenn G. New, has been Richmond's foremost wedding, corporate, architectural and commercial photography studio since 1975."> <meta name="keywords" content="Wedding Photography Wedding Photographers Professional Photographers Wedding Portraits Bridal Portraits Images Brides Bridal Weddings Corporate Architectural Commercial Richmond Virginia VA Va.">

</head>

<body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<br><br><br>
<table border="0" align="center" cellpadding="0" cellspacing="0" width="286">
  <tr>
    <td width="286"><img src="images_contact/spacer.gif" width="286" height="20"><br>
      <font style='font: bold 17px/18px arial,helvetica,sans-serif; color:#cccc99'>Thank You</font><br><br>
      <font style='font: 12px/18px arial,helvetica,sans-serif; color:#cccc99'>Thank you for contacting New Images Photography. I will get back to you as soon as possible to arrange a time for us to meet. I look forward to working with you to capture and preserve the memories for your special event.</font><br><br>
      
      <a href="#" onClick="window.top.close(); return false"><img src=images_contact/btn-close.gif border="0"></a></td>
  </tr>
</table>


</body>


</html>
kindly change do this, ..

it was $mail_body .... it should be $mail_body1

corrected code line,

mail($recipient, $subject, $mail_body1, $header); //mail command :)

Open in new window

Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

Ok, at least now I dont just get a BLANK form.. but I do get garbage, and not what is filled in.
I put 'test' in each area of the form and submitted.. this is what I get as the feedback, how do I just get the info that the potential customer fills in? Also, the thank you windows does not appear after they hit the submit button:

<html>
<body>
<table border='0' align='center' width='585' cellpadding='0' cellspacing='0'>
  <tr valign='top'>
    <td width='129'><img src='images_contact/spacer.gif' width='129' height='16'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='5' height='1'></td>
    <td align='left' width='251'><img src='images_contact/spacer.gif' width='251' height='16'></td>
    <td rowspan='10'><img src='../images/logo_contact.gif'><br>
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/name.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>test
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/street.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>test
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/city.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/phone_1.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>test
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/phone_2.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>test
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/email.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>test@test.com
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/date.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>--
    </td>
  </tr>
  <tr valign='top'>
    <td><img src='images_contact/wedding_location.gif' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left'>
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/rec_location.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left'>
    </td>
  </tr>
 
  <tr valign='top'>
    <td width='129'><img src='images_contact/spacer.gif' width='1' height='1'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='1'></td>
  </tr>
</table>
</body></html>
your inbox should support HTML mail read.. not just display text as mail... try to send to mail to your Gmail OR yahoo  and check it...

at the end , you have to redirect or pass some variable and check the success message,

uncomment this

    header("Location: " . $myFile );

Open in new window

Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

I uncommented out that line..
still getting 'junk'.. help!    
and NO thank you message...

Getting close... I do appreciate your help.. just tell me what else I need to try!

Ok, wait, i will try out in my online and get back.
Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

good day.. any assistance w/be appreciated please....
hi,

modify these lines,

you have missed to include the headers on the mail parameter...

you were used "header" instead of "headers"

  // To send HTML mail, the Content-type header must be set
        $headers  = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
 
        // Additional headers
        $headers .= "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields

Open in new window

in the mail command, see the included headers,

 mail($recipient, $subject, $mail_body1, $headers); //mail command :)

Open in new window

i hope now, you can customize the html table + redirection ... etc.,
final code,

<?php
 
function mail_body($arr_mail)
{
      $message = "<html>
<body>
<table border='0' align='center' width='585' cellpadding='0' cellspacing='0'>
  <tr valign='top'>
    <td width='129'><img src='images_contact/spacer.gif' width='129' height='16'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='5' height='1'></td>
    <td align='left' width='251'><img src='images_contact/spacer.gif' width='251' height='16'></td>
    <td rowspan='10'><img src='../images/logo_contact.gif'><br>
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/name.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['name']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/street.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['street']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/city.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['city']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/phone_1.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['home_phone']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/phone_2.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['work_phone']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/email.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['email']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/date.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left' width='251'>".$arr_mail['date']."
    </td>
  </tr>
  <tr valign='top'>
    <td><img src='images_contact/wedding_location.gif' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left'>".$arr_mail['wedding_location']."
    </td>
  </tr>
  <tr valign='top'>
    <td width='129'><img src='images_contact/rec_location.gif' width='129' height='23'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='30'></td>
    <td align='left'>".$arr_mail['reception_location']."
    </td>
  </tr>
 
  <tr valign='top'>
    <td width='129'><img src='images_contact/spacer.gif' width='1' height='1'></td>
    <td align='left'><img src='images_contact/spacer.gif' width='1' height='1'></td>
  </tr>
</table>
</body></html>";
      
      return $message;
 
}
 
//isset($_POST['mailto']) && (
if(isset($_POST['mailto']) && ($_POST['mailto']) != "")
{
     
            $Name = "www.newimagesphoto.com"; //senders name
       	 	$email = "no_reply@newimagesphoto.com"; //senders e-mail adress
        	
			$recipient = $_POST['mailto']; //recipient
            			 
            $arr_mail['name'] = $_POST['name'];
            $arr_mail['street'] = $_POST['street'];
            $arr_mail['home_phone'] = $_POST['home_phone'];
            $arr_mail['work_phone'] = $_POST['work_phone'];
            $arr_mail['email'] = $_POST['email'];
            $arr_mail['date'] = $_POST['date'];
            $arr_mail['wedding_location'] = $_POST['wedding_location'];
            $arr_mail['reception_location'] = $_POST['reception_location'];
            $arr_mail['comments'] = $_POST['comments'];
                  
        $mail_body1 = mail_body($arr_mail); //mail body
        $subject = "Feedback From Contact Form"; //subject
            
            //echo $mail_body1;
            //exit;                               
            
        // To send HTML mail, the Content-type header must be set
        $headers  = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
 
        // Additional headers
        $headers .= "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields
 
        mail($recipient, $subject, $mail_body1, $headers); //mail command :)
 
        echo "Mail is sent!";
        header("Location: form.html");
}
 
 
 
 
?>

Open in new window

Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

Thank you for your help...
for this comment of yours, I see no change.. I checked my code and it is exactly how you have it:
modify these lines,

you have missed to include the headers on the mail parameter...

you were used "header" instead of "headers"

For this comment (the next one down the line), I added the 's' to headers (I believe this is what you wanted me to do.
SOLUTION
Avatar of Loganathan Natarajan
Loganathan Natarajan
Flag of India image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
look at the attachment

header.JPG
Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

OK, after that 'header' change, the form come in my email and looks like this..  I typed in Beth as all of the answers w/exception of the date.

 
 
 
 

 
 
beth       
 
 
beth       
 
 
      
 
 
beth       
 
 
beth       
 
 
beth       
 
 
01       
 
 
      
 
 
      
you did not include the HTML mime headers on the mail function...

you were just used header="from>

not headers
You mean you got the mail and displayed these values .. is it correct?
Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

ok, I do get the form now.. I took your final code and inserted it into my code.  This is what i get now in the email:

ONE
ONE
ONE
03
ONE

I also do not get the 'thank you' note.. but that can wait.  As you see I only get part of the date here.. the first block... no day/year,,, only month
ASKER CERTIFIED SOLUTION
Avatar of mchyzik
mchyzik
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Hi,

you have to work .. let me work again and get back
Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

any update?
Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

thank you for all your help.. this worked!
Avatar of mchyzik
mchyzik
Flag of United States of America image

ASKER

wonderful assistance, thank you!
Scripting Languages
Scripting Languages

A scripting language is a programming language that supports scripts, programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator. Scripting languages are often interpreted (rather than compiled). Primitives are usually the elementary tasks or API calls, and the language allows them to be combined into more complex programs. Environments that can be automated through scripting include software applications, web pages within a web browser, the shells of operating systems (OS), embedded systems, as well as numerous games. A scripting language can be viewed as a domain-specific language for a particular environment; in the case of scripting an application, this is also known as an extension language.

30K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo