|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
form mail php probs!
now i have this project to hand in and im not to sure if this php script for a form mail will work...
<?php if (!$name) {echo "You must enter your name, Thank you"; } else { if (!$email) {echo "We need your email address so we can get back to you."; } else { if (!$telephone) {echo "sorry what was your number again."; } else { if (!$address) {echo "woops we need this information"; } else { echo "<HTML><HEAD><TITLE>Form Sent!</TITLE></HEAD><BODY>"; echo "<H1 align=center>Thank You, $_POST[sender_name]</H1>"; echo "<P align=center>Your feedback has been sent.</P>"; echo "</BODY></HTML>"; $recipient = "siw90@hotmail.com"; $subject = "Web Site Feedback"; $mailheaders = "From: My Web Site <> n"; $mailheaders .= "Reply-To: $_POST[sender_email]nn"; mail($recipient, $subject, $msg, $mailheaders); $msg = "name:n===================nt{$_POST[name]}n"; $msg .= "address:n=================nt{$_POST[address]}n"; $msg .= "city:n====================nt{$_POST[city]}n"; $msg .= "company:n=================nt{$_POST[company]}n"; $msg .= "emai:n====================nt{$_POST[email]}n"; $msg .= "telepone:n==================nt{$_POST[telephone]}n"; $msg .= "faxn======================n:t{$_POST[fax]}n"; $msg .= "magazine1:n=================nt[$_POST[magazine1]}n"; $msg .= "magazine:n==================nt{$_POST[magazine]}n"; $msg .= "trade1:n===================nt{$_POST[trade1]}n"; $msg .= "trade:n===================nt{$_POST[trade]}n"; $msg .= "word:n===================nt{$_POST[word]}n"; $msg .= "television1:n=================nt{$_POST[television1]}n"; $msg .= "television:n=================nt{$_POST[television]}n";. $msg .= "rother:n===================nt{$_POST[rother]}n"; $msg .= "use_rpt:n==================nt{$_POST[use_rpt]}n"; $msg .= "abs_form:n=================nt{$_POST[abs_form]}n"; $msg .= "wax_form:n=================nt{$_POST[wax_form]}n"; $msg .= "other_form:n=================nt{$_POST[other_form]}n"; $msg .= "concept_view:n=================nt{$_POST[concept_view]}n"; $msg .= "func_testing:n=================nt{$_POST[func_testing]}n"; $msg .= "rcasting:n===================nt{$_POST[rcasting]}n"; $msg .= "rsolid_works:n=================nt{$_POST[rsolid_works]}nmail"; $msg .= "auto_cad:n===================nt{$_POST[auto_cad]}n"; $msg .= "pro_eng:n==================nt{$_POST[pro_eng]}n"; $msg .= "other3:n==================nt{$_POST[other3]}n"; $msg .= "other4:n==================nt{$_POST[other4]}n"; $msg .= "comment_q:n=================nt{$_POST[comment_q]}n"; $msg .= "colour:n==================nt{$_POST[colour]}n"; $msg .= "RPNZ:n==================nt{$_POST[RPNZ]}n"; $msg .= "kept_to_date:n===============nt{$_POST[kept_to_date]}n"; $msg .= "info:n====================nt{$_POST[info]}n"; } } } } ?> |
|
#2
|
|||
|
|||
|
RE: form mail php probs!
I'm not sure if this is what you are after.
// check form input <?php if(empty($email)){ msg("Please fill in all fields!<br><br><a href="javascript:history.go(-1)" title="Previous Page"><< Previous Page</a>"); exit; } ?> //form input <form name="addcat" method="post" action="<?php echo $PHP_SELF ?>?addinfo=" enctype="multipart/form-data"> <table width="350" align="center" cellpadding="5" cellspacing="0" summary="form"> <tr> <td class="header2" align="center" colspan="2"><br> </td> </tr> <tr> <td width="104"> <div align="right">Name:</div></td> <td width="224"> <input type="text" size="30" name="name" class="input_fields" > </td> </tr> <tr> <td> <div align="right">E-mail:</div></td> <td> <input type="text" size="30" name="email" class="input_fields" > </td> </tr> <tr> <td align="center" colspan="2"> <input type="submit" name="addinfo" value="Add Now" title="Search Now" class="buttons"> </td> </tr> </table> </form> |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > form mail php probs! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|