2014-10-05 84 views
1

我有一个窗体,但它不会传递参数'url'和'USERNAME'到下一页。有什么不对?使窗体传递参数

我必须使用<button>而不是<input>来解决样式问题。

下面的形式:

<form action="/confirmation/index.php" method="post" class="form-wrap"> 
<div class="loader-wrap"> 
<div class="loader-txt"> 
</div> 
</div> 

<div class="field-set url-field"> 
<input type="text" name="url" data-placeholder="Your Website URL" maxlength="50" class="validate">. 
<button name="url_btn" type="button" class="btn url-btn">Scan My Site!</button> 
</div> 

<div class="field-set email-field"> 
<input type="text" name="USERNAME" data-placeholder="Your E-mail" maxlength="50" class="validate"> 
<button name="email_btn" type="button" class="btn email-btn" style="width:174px;font-size:15px;">Send me Results!</button> 
</div> 
</form> 
+0

是乌拉圭回合的形式开放标签(

)失踪了? – Todor 2014-10-05 15:10:54

+0

你有开放表格标签吗?还是你忘了复制它? – Rizier123 2014-10-05 15:11:25

+0

它在那里,只是答案没有正确格式化,所以编辑器“吃”了开始标签。 – Shomz 2014-10-05 15:13:20

回答

-1

这应该与提交按钮一起工作!

(额外的PHP是要表明,它的作品!)

<?php 

if (isset($_POST['submitted'])) { 
    echo "form submitted"; 
} 
?> 

<form action="index.php" method="post" class="form-wrap"> 
    <div class="loader-wrap"> 
     <div class="loader-txt"> 
     </div> 
    </div> 

    <div class="field-set url-field"> 
     <input type="text" name="url" data-placeholder="Your Website URL" maxlength="50" class="validate">. 
     <button name="url_btn" type="button" class="btn url-btn">Scan My Site!</button> 
    </div> 

    <div class="field-set email-field"> 
     <input type="text" name="USERNAME" data-placeholder="Your E-mail" maxlength="50" class="validate"> 
     <button name="email_btn" type="button" class="btn email-btn" style="width:174px;font-size:15px;">Send me Results!</button> 
     <button name="submitted" type="submit">Send me the results</button> //Submit Button 
    </div> 
</form>