我創建的HTML一個簡單的登記表,並通過郵寄方式提交它register.php這是一個新的目錄下的控制器。當我提交表單時,它會重定向到錯誤的URL。
這是形式:
形式提交到錯誤的URL在PHP
<form action="controller/register.php" method="post" enctype="multipart/form-data" id="pre-registration-form">
<fieldset>
<legend><span>Type of Entry</span></legend>
<table id="rally-type">
<tr>
<td>Sponsored</td>
<td>Non-sponsored</td>
</tr>
<tr>
<td><input type="radio" id="xtreme" name="entry-type" value="xtreme" /></td>
<td><input type="radio" id="ndure" name="entry-type" value="ndure" /></td>
</tr>
</table>
</fieldset>
<fieldset>
<legend>
<span>Vehicle Details</span>
</legend>
<table>
<tr>
<td>Category</td>
<td><select name="vehicle-category" id="vehicle-category-list">
<option value="0">Select</option>
<option value="2whlr">2 Wheeler</option>
<option value="2whlr">4 Wheeler</option>
<option value="2whlr">4 Wheel Drive</option>
</select></td>
<td>Make</td>
<td>
<select name="vehicle-make">
<option value="0">....</option>
<option value="1">....</option>
.
.
.
</select>
</td>
</tr>
<tr>
<td>Model</td>
<td><input type="text" name="make-model" /></td>
<td>Year</td>
<td><input type="text" name="make-year" /></td>
</tr>
</table>
</fieldset>
.
.
.
.
<input type="submit" name="submit" value="Submit" />
當我嘗試提交表單,它重定向到controller/index.php
而非controller/register.php
當我重新命名register.php
文件index.php
那麼火狐給以下錯誤:
The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
This problem can sometimes be caused by disabling or refusing to accept cookies.
我已經在WAMP以及燈服務器嘗試這樣做,都產生了同樣的錯誤。什麼可能是這個問題的根源?
告訴我們你的register.php文件,我覺得你有一個301重定向那裏 – DevZer0
你可以與我們分享你的register.php文件嗎? –
你可以與我們分享controller/index.php嗎? –