You are here: Email handler problem « PHP Programming Language « IT news, forums, messages
Email handler problem

Posted by Danny Smith on 11/20/06 21:59

Hi folks,

I'm having problems with my PHP form handler. It used to work correctly, but
now for some reason its not. I'm hoping someone here could take a look and
tell me where I might have gone wrong.

Just for background info, when I click submit the form sends okay, but when
the email arrives in my inbox the $name value is non-existent - like nothing
had been entered in the box on the web page form.

Also, I'm not sure if this is relevant: The server uses PHP version 4.4.4


The form handler: (scripts/ct_em.php)

<?
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;

mail( "ME@MYDOMAIN.COM", "SUBJECT OF THE EMAIL",
"NAME: $name \n\n
EMAIL ADDRESS: $email \n\n
MESSAGE FOLLOWS BELOW: \n
$message",
"From: $email" );
header( "Location: THANK-YOU PAGE" );
?>


The form: (03_contact.html) - it should be noted that I've got a Javascript
validation script that checks the length of the value of the email address
field to ensure that it's not left blank - it's had no impact on the form
working or not working - when the form did work this Javascript was always
present.

<form enctype="multipart/form-data" method="post" action="scripts/ct_em.php"
name="form1">

<table width=288 cellpadding=0 cellspacing=0>
<tr valign=center>
<td class="body_mid" width=288>Name:<br><input name="name"
style="font-size: 12px; width: 288px; height: 19px;"></td>
</tr>
<tr valign=center>
<td width=288 height=5></td>
</tr>
<tr valign=center>
<td class="body_mid" width=288>Email address:<br><input name="email"
style="font-size: 12px; width: 288px; height: 19px;"></td>
</tr>
<tr valign=center>
<td width=288 height=5></td>
</tr>
<tr valign=top>
<td class="body_mid" width=288>Your message:<br><textarea name="message"
style="font-family: Arial; font-size: 12px; width: 288px; height:
50px;"></textarea></td>
</tr>
<tr valign=center>
<td width=288 height=10></td>
</tr>
<tr valign=center>
<td width=288><a href="javascript:document.form1.submit()"
OnMouseOver="se.src='images/bu_se_lt.gif'"
OnMouseOut="se.src='images/bu_se_dk.gif'" onClick="return validate();"><img
name="se" id="se" src="images/bu_se_dk.gif" alt="Send" border="0"></a></td>
</tr>
</table>

</form>

Thanks for your time folks!

Regards,

Danny.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация