2014-10-05 114 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>