我正在開發一個用於響應幫助請求的自動化系統,並且我希望能夠弄清楚使用它的客戶端對於獲取的響應是否滿意。使用提交按鈕進行PHP滿意度調查
程序應該詢問他們「你對你的回答滿意」,在其下面是/否提交按鈕,當用戶提交它時,應該將它們轉發到指定頁面並調用sendDebugMessage函數(向我們發送電子郵件)
這是我的工作了這樣做的代碼,但它只是重定向到一個空白頁:
<?php
if (isset($_POST['Yes'])) {
?>
sendDebugMessage("A user WAS happy with their response!");
<META http-equiv="refresh" content="0; URL=http://example.com">
<?php
} elseif (isset($_POST['No'])) {
sendDebugMessage("A user was NOT happy with their response!");
?>
<META http-equiv="refresh" content="0; URL=http://example.com">
<?php
} else {
?>
Where you happy with this response?
<form action="" method="post">
<input type="submit" value="Yes" name="Yes" />
<input type="submit" value="No" name="No"/>
</form>
<br />
<?php
}
?>
是'sendDebugMessage'返回任何錯誤 – Ander2
不,它是不會放棄的錯誤? –
首先'sendDebugMessage'函數調用,在'if'外面# – Ander2