PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old November 4th, 2002, 08:10 AM
sli sli is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 5 sli User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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";

}
}
}
}


?>

Reply With Quote
  #2  
Old November 4th, 2002, 08:36 AM
tryhard tryhard is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Brisbane Australia
Posts: 187 tryhard User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 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>




Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > form mail php probs!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway