我正在本地工作,我正在嘗試向它添加聯繫表單。PHP URL重定向
我已經添加了一個簡單的表單:http:localhost:8888/testsite/contact.php,當用戶點擊提交按鈕時,我希望他們被重定向到另一個頁面上,並顯示一條消息。我希望用戶在提交表單後訪問的頁面:contact_message.php。
我已經創建了這兩個文件,它們都在那裏顯示確定URL- http:localhost:8888/testsite/contact.php和http:localhost:8888/testsite/contact-message.php,但是表單不是因爲當你點擊提交url更改爲:http:localhost:8888/testsite/contact.php/contact-message.php時,如果它顯示contact-message.php內容,它會很好,但事實並非如此。
脫穎而出形式的代碼是:
<form method="post" action="contact-message.php">
<table>
<tr>
<th>
<label for="name">Name</label>
</th>
<td>
<input type="text" name="name" id="name">
</td>
</tr>
<tr>
<th>
<label for="email">Email</label>
</th>
<td>
<input type="text" name="email" id="email">
</td>
</tr>
<tr>
<th>
<label for="message">Message</label>
</th>
<td>
<textarea type="text" name="message" id="message"></textarea>
</td>
</tr>
</table>
<input type="submit" value="Send">
</form>
沒有任何人有任何想法...?
感謝
你肯定接觸,message.php腳本實際上在工作嗎?語法錯誤可能會在執行ANY輸出之前終止腳本,留下空白瀏覽器。例如自己做一些基本的調試... –