我是一名网络开发学生,我正在努力寻找一种方法来感谢从我的网站提交联系表单的访问者。我要感谢他们在感谢页面上的名字。以下是我的表格代码。请帮助学生学习。
<form action="http://www.MySiteUrl/cgi-sys/formmail.pl" method="post" enctype="plain/text" id="Contact">
<input name="Name" type="text" class="quoteboxes" id="Name" />
<span class="textfieldRequiredMsg">Name is required.</span></span></div>
<!-- End InputFavSite -->
<div id="inputneed">
<label>Email </label><span id="sprytextfield6">
<input name="Email" type="text" class="quoteboxes" id="Email" />
<span class="textfieldRequiredMsg">E-mail is required.</span><span class="textfieldInvalidFormatMsg">Opse! your E-mail is wrong.</span></span></div>
<!-- End InputNeed -->
<div id="inputbudjet"> <label>Phone </label><span id="sprytextfield7">
<input name="Phone" type="text" class="quoteboxes" id="Phone" />
<span class="textfieldRequiredMsg">Phone is required.</span><span class="textfieldInvalidFormatMsg">Opse! your number is wrong..</span></span></div>
<!-- End InputBudget -->
<div id="inputtime">
<label>Subject </label> <span id="sprytextfield8">
<input name="Subject" type="text" class="quoteboxes" id="Subject" />
<span class="textfieldRequiredMsg">Subject is required.</span></span></div>
<!-- End InputTime -->
<div id="ccontact"><span id="sprytextarea">
<textarea name="Message" class="quotemessase" id="Message"></textarea>
<span class="textareaRequiredMsg">Message is required.</span></span></div><!-- End QuoteButtRight -->
<div id="contactbttn">
<input name="sender" type="submit" value="click to send your message" />
</div><!-- End ContactBttn -->
</div><!-- End QuoteTopRight-->
</div><!-- End QuoteTop -->
<input type="hidden" name="recipient" value="info@siteripe.com" />
<input type="hidden" name="redirect" value="yourURL/Thankspage" />
</form>
答案 0 :(得分:2)
您可以在提交表单之前将名称值保存到cookie中(使用javascript),然后使用javascript从cookie中获取它。
http://www.quirksmode.org/js/cookies.html
或使用服务器端语言(php等)
答案 1 :(得分:2)
如果您想要一个便宜的javascript版本(没有服务器端代码),您可以执行以下操作:
?name={name here}
附加到redirect
变量。thanks.html
上,阅读querystring变量并将屏幕显示给用户。答案 2 :(得分:0)
正如我所说,我使用了PHP Form邮件,杀死了重定向的Code行,然后使用
<?php echo $_POST["name"]; ?>,