我在我的智慧結束在這裏,我肯定這是一些荒謬的打字錯誤,或者我忘記寫一些東西。表單不會發送任何數據到查詢字符串
無論如何,我試圖將數據從twitter引導模式內的表單發送到使用PHPMailer腳本的名爲'processed.php'的文件。 但是,當我提交表單沒有數據被傳遞給查詢字符串的URL只是變成'/processed.php?'
如果任何人都可以闡明它,我會非常感激。
下面的代碼:
HTML FIRST:
<div class="modal-body">
<form id="send-msg" method="GET" action="processed.php">
<fieldset>
<div class="control-group">
<label class="control-label" for="inputNavn">Navn:</label>
<div class="controls">
<input type="text" class="input-medium required" id="inputNavn">
</div>
</div>
<div class="control-group">
<label class="control-label" for="inputTlf">Telefon nummer:</label>
<div class="controls">
<input type="text" class="input-medium required" id="inputTlf">
</div>
</div>
<div class="control-group">
<label class="control-label" for="inputMsg">Besked:</label>
<div class="controls">
<textarea class="input-large required" id="inputMsg" rows="3"></textarea>
</div>
</div>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary btn-large" id="inputSend" href="#" rel="popover" data-content="Vi vender tilbage hurtigst muligt." data-original-title="Send besked" data-loading-text="Sender besked…">Send besked</button>
</div>
</div>
</fieldset>
</form>
<div id="results" class="alert alert-info span2">
<p>Udfyld venligst alle felter.</p>
</div>
</div>
現在PHP:
<?php
$navn= $_REQUEST['inputNavn'];
$tlf= $_REQUEST['inputTlf'];
$besked= $_REQUEST['inputMsg'];
require_once('PHPMailer/class.phpmailer.php');
...(The rest is just the PHPMailer script)
echo $navn;
?>
反正我沒有得到的查詢字符串什麼。 希望有人能幫助我。
非常感謝!
唐」的ID使用PHP我認爲,這是完全正確的。 – ALH
@علیرضا請注意添加更多信息,以便在需要時更新答案? – detaylor
非常感謝你們的快速回答,我不能相信我忘記了!非常感謝! – mackwerk