[請益] 關於email表單
第一次用php做表單...
研究很久...終於有一個頭緒,但還是有些問題想不出來是哪裡出了錯...
想請諸位高手幫忙,網站如下,謝謝
http://www.chromoink.com/Chromoink%20New/red2.html
在收到mail時發生一些問題
問題一:
其First Name、Last Name及Current Suppliers都無法顯示
問題二:
在收到mail其寄件者如何設定才可以將表單裡的Email放置到其收到mail的寄件人位置
開題三:
如果沒有輸入First Name或其他空格怎麼回到表單頁請他重寫
我的原始檔如下:
===============mail.php================
<?
if ($_POST['msg']!="") {
$F01=$_POST['First Name'];
$F02=$_POST['Last Name'];
$Address=$_POST['Address'];
$City=$_POST['City'];
$State=$_POST['State'];
$Country=$_POST['Country'];
$Phone=$_POST['Phone'];
$Fax=$_POST['Fax'];
$Email=$_POST['Email'];
$F03=$_POST['Current Suppliers'];
$msg=$_POST['msg'];
$sendmsg="
First Name: $F01
Last Name: $F02
Address: $Address
City: $city
State: $State
Country: $Country
Phone: $phone
Fax: $Fax
Email: $Email
Current Suppliers: $F03
Comment: $msg
";
$sendsubject=$name."Enquiry";
$harder="From: $EmailnReply-To: $EmailnX-Mailer: PHP/";
$harder .= "MIME-Version: 1.0nContent-Type: text/html ;charset=big5";
if (mail("XXXX@chromoink.com", $sendsubject,$sendmsg,harder. phpversion()))
{
echo "Thank You. Your message has been successfully transferred!!";
}
}else{
echo "Error!!Insert your comments.";
}
?>
===============red2.html===============
<form method=post action="mail2.php">
<TABLE height="486" cellSpacing=0>
<TBODY>
<TR>
<TD height="63" colSpan=2 align=right class=homesmall>
<div align="left" class="style11
style1">Dstributor(Abplication for distributor) </div>
<p> </p></TD>
</TR>
<TR>
<TD width="88" align=right class=homesmall><P align="right"
class="style5 style3 style4"><span class="style12">* </span>First name:
</P></TD>
<TD width=411><P class="style5">
<INPUT type="text" name="F03" size="30" >
</P></TD>
</TR>
<TR>
<td><div align="right"><span class="style5">Last
name:</span></div></td>
<TD class=homesmall align=right><div align="left"><span
class="style5">
<input type="text" name="F02" size=30 >
</span></div></TD>
</TR>
<TR>
<td><div align="right" class="style5">
<div align="right">* Company: </div>
</div></td>
<TD class=homesmall align=right><P align="left" class="style5
style3 style4">
<input type="text" name="Company" size=30 >
</P></TD>
</TR>
<TR>
<TD class=homesmall align=right><P align="right" class="style5
style3 style4"> Address: </P></TD>
<TD><P class="style5">
<INPUT type="text" name="Address" size=30>
</P></TD>
</TR>
<TR>
<TD class=homesmall align=right><P align="right" class="style5
style3 style4"><span class="style13">*</span> City: </P></TD>
<TD><P class="style5">
<SELECT name="City" size=1 >
<OPTION>Africa / Botswana</OPTION>
<OPTION>Africa / Congo</OPTION>
<OPTION>Africa / Egypt</OPTION>
<OPTION>Africa / Ethiopia</OPTION>
<OPTION>Africa / Ghana</OPTION>
<OPTION>Africa / Libya</OPTION>
<OPTION>Africa / Morocco</OPTION>
<OPTION>Africa / Mozambique</OPTION>
<OPTION>Africa / Namibia</OPTION>
<OPTION>Africa / Nigeria</OPTION>
<OPTION>Africa / Reunion</OPTION>
<OPTION>Africa / South Africa</OPTION>
<OPTION>Africa / Tunisia</OPTION>
<OPTION>Africa / Zambia</OPTION>
<OPTION>Africa / Zimbabwe</OPTION>
<OPTION>Africa / Other</OPTION>
<OPTION>Asia / Bangladesh</OPTION>
<OPTION>Asia / China</OPTION>
<OPTION>Asia / Hong Kong</OPTION>
<OPTION>Asia / India</OPTION>
<OPTION selected>Asia / Indonesia</OPTION>
<OPTION>Asia / Japan</OPTION>
<OPTION>Asia / Kazakhstan</OPTION>
<OPTION>Asia / Korea</OPTION>
<OPTION>Asia / Malaysia</OPTION>
<OPTION>Asia / Mongolia</OPTION>
<OPTION>Asia / Myanmar</OPTION>
<OPTION>Asia / Nepal</OPTION>
<OPTION>Asia / Philippines</OPTION>
<OPTION>Asia / Saipan</OPTION>
<OPTION>Asia / Singapore</OPTION>
<OPTION>Asia / Sri Lanka</OPTION>
<OPTION>Asia / Taiwan</OPTION>
<OPTION>Asia / Thailand</OPTION>
<OPTION>Asia / UAE</OPTION>
<OPTION>Asia / Vietnam</OPTION>
<OPTION>Asia / Other</OPTION>
<OPTION>Central America / Aruba</OPTION>
<OPTION>Central America / Costa Rica</OPTION>
<OPTION>Central America / Dominican Republic</OPTION>
<OPTION>Central America / Guatemala</OPTION>
<OPTION>Central America / Nicaragua</OPTION>
<OPTION>Central America / Other</OPTION>
<OPTION>Europe / Austria</OPTION>
<OPTION>Europe / Belgium</OPTION>
<OPTION>Europe / Bulgaria</OPTION>
<OPTION>Europe / Croatia</OPTION>
<OPTION>Europe / Cyprus</OPTION>
<OPTION>Europe / Czech Republic</OPTION>
<OPTION>Europe / Denmark</OPTION>
<OPTION>Europe / Finland</OPTION>
<OPTION>Europe / France</OPTION>
<OPTION>Europe / France</OPTION>
<OPTION>Europe / Germany</OPTION>
<OPTION>Europe / Greece</OPTION>
<OPTION>Europe / Hungary</OPTION>
<OPTION>Europe / Ireland</OPTION>
<OPTION>Europe / Italy</OPTION>
<OPTION>Europe / Kazakhstan</OPTION>
<OPTION>Europe / Kirkzstan</OPTION>
<OPTION>Europe / Latvia</OPTION>
<OPTION>Europe / Lithuania</OPTION>
<OPTION>Europe / Malta</OPTION>
<OPTION>Europe / Netherlands</OPTION>
<OPTION>Europe / Norway</OPTION>
<OPTION>Europe / Poland</OPTION>
<OPTION>Europe / Romania</OPTION>
<OPTION>Europe / Russia</OPTION>
<OPTION>Europe / Serbia and Montenegro</OPTION>
<OPTION>Europe / Slovakia</OPTION>
<OPTION>Europe / Slovenia</OPTION>
<OPTION>Europe / Spain</OPTION>
<OPTION>Europe / Sweden</OPTION>
<OPTION>Europe / Turkey</OPTION>
<OPTION>Europe / U.K.</OPTION>
<OPTION>Europe / Ukraine</OPTION>
<OPTION>Europe / Other</OPTION>
<OPTION>Middle East / Bahrain</OPTION>
<OPTION>Middle East / Iran</OPTION>
<OPTION>Middle East / Israel</OPTION>
<OPTION>Middle East / Jordan</OPTION>
<OPTION>Middle East / Kuwait</OPTION>
<OPTION>Middle East / Lebanon</OPTION>
<OPTION>Middle East / Qatar</OPTION>
<OPTION>Middle East / Saudi Arabia</OPTION>
<OPTION>Middle East / Syria</OPTION>
<OPTION>Middle East / U.A.E.</OPTION>
<OPTION>Middle East / Yemen</OPTION>
<OPTION>Middle East / Other</OPTION>
<OPTION>North America / Canada</OPTION>
<OPTION>North America / Mexico</OPTION>
<OPTION>North America / U.S.A.</OPTION>
<OPTION>North America / Other</OPTION>
<OPTION>Oceania / Australia</OPTION>
<OPTION>Oceania / New Zealand</OPTION>
<OPTION>Oceania / Polynesia</OPTION>
<OPTION>Oceania / The Papua New Guinea</OPTION>
<OPTION>Oceania / Other</OPTION>
<OPTION>South America / Argentina</OPTION>
<OPTION>South America / Bolivia</OPTION>
<OPTION>South America / Brazil</OPTION>
<OPTION>South America / Chile</OPTION>
<OPTION>South America / Colombia</OPTION>
<OPTION>South America / Ecuador</OPTION>
<OPTION>South America / Guatemala</OPTION>
<OPTION>South America / Paraguay</OPTION>
<OPTION>South America / Peru</OPTION>
<OPTION>South America / Uruguay</OPTION>
<OPTION>South America / Venezuela</OPTION>
<OPTION>South America / Other</OPTION>
<OPTION>Other / Other</OPTION>
</SELECT>
</P></TD>
</TR>
<TR>
<TD class=homesmall align=right><P align="right" class="style5
style3 style4">State: </P></TD>
<TD><P class="style5">
<INPUT type="text" name="State" size=30>
</P></TD>
</TR>
<TR>
<TD class=homesmall align=right><P align="right" class="style5
style3 style4">Country: </P></TD>
<TD><P class="style5">
<INPUT type="text" name="Country" size=30 >
</P></TD>
</TR>
<TR>
<TD class=homesmall align=right><P align="right" class="style5
style3 style4"><span class="style13">*</span> Phone: </P></TD>
<TD><P class="style5">
<INPUT type="text" Name="phone" size=30 >
</P></TD>
</TR>
<TR>
<TD class=homesmall align=right><P align="right"
class="style5">Fax: </P></TD>
<TD><P class="style5">
<INPUT type="text" name="Fax" size=30 >
</P></TD>
</TR>
<TR>
<TD class=homesmall align=right><P align="right"
class="style5"><span class="style13">*</span> Email: </P></TD>
<TD><P class="style5">
<INPUT type="text" name="Email" size="30" >
</P></TD>
</TR>
<TR>
<TD class=homesmall align=right><P align="right" class="style5
style3 style4"><span class="style13">* </span>Current<br>
Suppliers: </P></TD>
<TD><P class="style5">
<INPUT type="text" name="F03" size=30 ">
</P></TD>
</TR>
<TR>
<TD colSpan=2><P class="style6 style3 style4"><span
class="style13">*</span>My Comments are Please tell us about yourself so we
can tailor our services to
fit your needs:</P></TD>
</TR>
<TR>
<TD colSpan=2><textarea name="msg" cols="50" rows="10"
id="msg"></textarea></TD>
</TR>
<TR>
<TD colSpan=2><input name="submit" type="submit" value="Submit" />
<input type="submit" value="Reset" /></TD>
</TR>
</TBODY>
</TABLE>
</form>
</div>
</div>
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 125.229.0.184
→
05/11 14:20, , 1F
05/11 14:20, 1F
討論串 (同標題文章)
PHP 近期熱門文章
PTT數位生活區 即時熱門文章