Formmail重定向问题

时间:2012-01-18 23:56:08

标签: php html scripting formmail

我正在尝试使用Formmail表单重新指向它自己的页面。例如,如果我在页面上http://www.rightfittech.com/paincenter/contact-us.html,我希望重定向返回http://www.rightfittech.com/paincenter/contact-us.html,这是同一页。

我疯狂搜索谷歌,没有任何值得的结果。论坛一直在说创建一个隐藏的输入字段

但这不起作用!!!

我的代码如下,请注意我没有修改电子邮件地址除外!

<form action="http://www.rightfittech.com/paincenter/formmail.php" name="Contact" method="post"
id="form1">
             <input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER" >
             <input type="hidden" name="redirect" value="http://www.rightfittech.com/paincenter/contact-us.html"/>
             <input type="hidden" name="recipients" value="robertmyrick@hotmail.com" >
             <input type="hidden" name="mail_options" value="FromAddr=robertmyrick@hotmail.com" > 
             <input type="hidden" name="subject" value="New Contact" >
          <div class="wrapper row-2">
            <div class="col-1">
              <div class="form">
                <label>First Name:</label>
                <input type="text" />
              </div>
              <div class="form">
                <label>Last Name:</label>
                <input type="text" />
              </div>
              <div class="form">
                <label>E-mail:</label><br/>
                <input type="text" />
              </div>
              <div class="form">
                <label>Phone Number:</label>
                <input type="text" />
              </div>
            </div>
            <div class="col-2">
              <div>
                <label>Enter Your Message:</label>
                <textarea cols="1" rows="1"></textarea>
              </div>

              <div class="wrapper">
              <div class="alignright" style="float:left">
              <a href="#" class="link2" onclick="document.getElementById('form1').reset()"><em><b>Clear</b></em></a>

              <div style="width:20px; float:left">&nbsp;</div>

              <a href="#" class="link2" onclick="document.getElementById('form1').submit()"><em><b>Submit</b></em></a></div>
                                                            </div>
        </form>

1 个答案:

答案 0 :(得分:3)

尝试设置值good_url而不是redirect

像这样:

<input type="hidden" name="good_url"
       value="http://www.rightfittech.com/paincenter/contact-us.html"/>