Thanks Daniel. I do not understand the part where I need to call the menu "to". What needs to be added here ?
Code:
<script type="text/JavaScript">
function clearDefault(el) {
if (el.defaultValue==el.value) el.value = ""
}
</script>
<form name="form1" method="post" action="contact.php">
<input type="hidden" name="action" value="send">
<table><tr><td align=left valign=top>
<input type="text" name="name" value=" your name" onfocus="clearDefault(this)" style="border-top:0px; border-left: 1px dotted #cc6600; border-right:0px; border-bottom: 1px dotted #cc6600; width:160px; margin-top:24px;">
<input type="text" name="email" value=" your email adress" onfocus="clearDefault(this)" style="border-top:0px; border-left: 1px dotted purple; border-right:0px; border-bottom: 1px dotted purple; width:160px; margin-top:20px;">
<select>
<option>sales</option>
<option>director</option>
<option>web</option>
</select> <img src="images/vink.gif" border="0" style="padding-left:10px; margin-top:26px;"><input type="submit" value="send" style="border:0px; background-color: #ffffff; margin-top:26px;">
</td><td align=left valign=top>
<textarea name="message" style="border-top:0px; border-left:1px dotted #0066cc; border-right:0px; border-bottom: 1px dotted #0066cc; width:240px; height:96px; margin-top:24px;" onfocus="clearDefault(this)"> your message</textarea>
</td></tr></table>
</form>
where "sales", "director" and "web", when chosen, should have the message sent to a different mail adres.
So this then what the php looks like, right ?
Code:
<?php
if ($_POST["action"] == "send"){
if ($_POST[name] != " your name" and $_POST[name] != "" and $_POST[email] != " your e-mail adress" and $_POST[email] != "" and $_POST[message] != "") {
mail ("$_POST['to']", "via NET",
"
Name: ".$_POST['name']."
E-mail: ".$_POST['email']."
Message: ".$_POST['message']."
",
"From: ".$_POST['name']." <".$_POST['email'].">");
echo '<br> <br>Thanks ! <br> <br>Your message has been sent,<br> and you will receive a confirmation mail. <br> <br> <br> NET will get back to you within two working days.<br> <br> <br>';
}
else{
echo '<br> <br><font color="#565656;">Your mail has NOT been sent !</font><br> <br>Please fill in all data.<br>Your name, email adress and message are mandatory fields.<br> <br> <br><a href="about.php"><font color="#565656;">[again please]</font></a><br> <br>';
}
}
?>
Bookmarks