I want to be able to have the email form data saved to variables
Then sent to the database so that I can retreive data later if needs be.
Also is it possible to re-use this kind of script to send data from any other form.
the code I have used is as follows.
contacttest.php
Code: Select all
<body>
<form name="form1" method="post" action="sendmailtest.php">
<table width="99%" border="0" align="center" cellpadding="1" cellspacing="0">
<tr>
<td width="44%"><div align="right">Your Name:</div></td>
<td width="56%"><input name="name" type="text" id="name"></td>
</tr>
<tr>
<td><div align="right">Your E-Mail:</div></td>
<td><input name="mail" type="text" id="mail"></td>
</tr>
</table>
<div align="center"><br>
Comment:<br>
<br>
<textarea name="comment" cols="50" rows="6" id="comment"></textarea>
<br>
<br>
<table width="99%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td>
<div align="right">
<input type="submit" value="Send Form">
</div></td>
<td><input type="reset" name="Submit2" value="Reset Form"></td>
</tr>
</table>
</div>
</form>
<br>
<br>
<br>
<br>
<br>
</body>
and the php script for the email (sendmail) sendmailtest.php
<body>
<?php
$yourmail = "me@pellsweb.co.uk"; // put your e-mail here
$t1 = $_POSTї'name'];
$t2 = $_POSTї'mail'];
$t3 = $_POSTї'comment'];
$data = "This is an automated mail. Someone submited the form and this is what he had to say:\nHis Name: $t1\nHis mail: $t2\nComment: $t3\n";
mail ($yourmail, "The Form", $data); // The Form mean subject of mail you will receive
die ("Form submited\n");
?>
<br>
<br>
<br>
<br>
<br>
</body>thanks philweb
feyd | time to read the posting guidelines.