Page is a not externally linkable
pp46 - 10:02 am on Sep 28, 2011 (gmt 0)
I have a simple form on all my sites sent with the mail function.
At present it has just the email field which ensures that we get senders email (as ling as he fills it out correctly)
and the message text area
I have tried adding the field and the corresponding variables
but I am getting nowhere.
I will post the code here and if somebody can put me on the right track
pls note that I am not very PHP proficient, I work with existing scripts but can not write it
here is the form
<!--Start form table--><br><br>
<table width="450" cellspacing="2" border="0" cellpadding="2" align="center">
<tbody align="left" valign="middle">
<tr>
<td><form method="post" action="sendmail.php">
Votre Email: <input name="email" type="text" class="input" /><br />
Votre Message:<br />
<textarea name="message" rows="18" cols="60" class="input" >
</textarea><br />
<input type="submit" value="Envoyer" class="button" />
</form></td>
</tr>
</tbody>
</table>
<!--End form table-->
and here is the sendmail.php file <?php
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
if (!isset($_REQUEST['email'])) {
header( "Location: http://www.somedomain.com/thanks.php" );
}
elseif (empty($email) || empty($message)) {
?>
<html>
<head>
<body>
<table width="960" cellspacing="2" border="0" cellpadding="2" align="center" bgcolor=#E7CE97>
<tbody>
</tr>
<tr>
<td>You have not filled in all the fields
<br> <a href="contact.php" target="_self">please click here and start again</a><br><br><br><br><br></td>
</tr>
</tbody>
</table>
</body>
</html>
<?php
}
else {
mail( "contact@somedomain.com", "Message from somedomain.com",
$message, "From: $email" );
header( "Location: http://www.somedomain.com/thanks.php" );
}
?>
What I would like would be the following
<!--Start form table--><br><br>
<table width="450" cellspacing="2" border="0" cellpadding="2" align="center">
<tbody align="left" valign="middle">
<tr>
<td><form method="post" action="sendmail.php">
Votre Email: <input name="email" type="text" class="input" /><br />
Votre Nom: <input name="name" type="text" class="input" /><br /><br>
Votre Tel: <input name="tel" type="text" class="input" /><br /><br>
Votre Message:<br />
<textarea name="message" rows="18" cols="60" class="input" >
</textarea><br />
<input type="submit" value="Envoyer" class="button" />
</form></td>
</tr>
</tbody>
</table>
<!--End form table-->
Thanks for any help