表单提交到错误的URL在PHP中

I am creating a simple registration form in html and submitting it via post method to register.php which is under a directory named controller. When I submit the form, it redirects to wrong URL.
This is the form:

<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" />

When I try to submit the form, it redirects to controller/index.php rather than controller/register.php
When I rename register.php file to index.php then the firefox gives the following error:

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.



I have tried this on wamp as well as lamp server and both produces the same error. What might be the root of this problem?



 2 条回答