now i had edit the html part, but the php part i dont know how to edit because i dont know php code totally.
HTML :
<form method="post" action="contact.php"> <table width="400" align=center bgcolor=#ffffff> <tr><td width="150"><p>Division:</p></td><td width="250"><p><input type="checkbox" name="sendto" value="support@vivacenetwork.co.cc" checked="checked" />Support</input></p></td></tr> <tr><td><p><font color=red>*</font> Name:</p></td><td><input size=30 name="Name"></td></tr> <tr><td><p><font color=red>*</font> Contact No.:</p></td><td><input size=30 name="Contact No."></td></tr> <tr><td><p><font color=red>*</font> Mailing Address:</p></td><td><textarea name="Mailing Address" rows=3 cols=30></textarea></td></tr> <tr><td><p><font color=red>*</font> Email:</p></td><td><input size=30 name="Email"></td></tr> <tr><td><p><font color=red>*</font> Item Code:</p></td><td><select><option>Item 1</option><option>Item 2</option></select> </td></tr> <tr><td colspan=2 align=center><input type=submit name="send" value="Submit"> <input type=reset value="Reset" /></td></tr> <tr><td colspan=2 align=center><p><small>A <font color=red>*</font> indicates a field is required</small></p></td></tr> </table> </form> </body>
pHp :
<?php
$to = $_REQUEST['sendto'];
$from = $_REQUEST['Email'];
$name = $_REQUEST['Name'];
$headers = "From: $from";
$subject = "Website Support";
$fields = array();
$fields{"Name"} = "Name";
$fields{"Email"} = "Email";
$fields{"Message"} = "Message";
$body = "We have received the following information:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }
$headers2 = "From: noreply@vivacenetwork.co.cc";
$subject2 = "Thank you for contacting us";
$autoreply = "Thank you for contacting us. Somebody will get back to you as soon as possible, usualy within 48 hours. If you have any more questions, please consult our forum at http://forum.vivacenetwork.co.cc";
if($from == '') {print "You have not entered an email, please go back and try again";}
else {
if($name == '') {print "You have not entered a name, please go back and try again";}
else {
$send = mail($to, $subject, $body, $headers);
$send2 = mail($from, $subject2, $autoreply, $headers2);
if($send)
{header( "Location: http://vivacenetwork.co.cc/thankyou.htm" );}
else
{print "We encountered an error sending your mail, please notify support@vivacenetwork.co.cc"; }
}
}
?>
i hope some one can give me some example so that i can make it work as a order form. Thanks alot for thoose who reading and helping me.
P/S : Sorry if I got any broken English.

New Topic/Question
Reply




MultiQuote



|