Form submitting to wrong url in php <p>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.<br/> <strong>This is the form:</strong><br/></p> <pre><code>&lt;form action="controller/register.php" method="post" enctype="multipart/form-data" id="pre-registration-form"&gt; &lt;fieldset&gt; &lt;legend&gt;&lt;span&gt;Type of Entry&lt;/span&gt;&lt;/legend&gt; &lt;table id="rally-type"&gt; &lt;tr&gt; &lt;td&gt;Sponsored&lt;/td&gt; &lt;td&gt;Non-sponsored&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;input type="radio" id="xtreme" name="entry-type" value="xtreme" /&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="radio" id="ndure" name="entry-type" value="ndure" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/fieldset&gt; &lt;fieldset&gt; &lt;legend&gt; &lt;span&gt;Vehicle Details&lt;/span&gt; &lt;/legend&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;Category&lt;/td&gt; &lt;td&gt;&lt;select name="vehicle-category" id="vehicle-category-list"&gt; &lt;option value="0"&gt;Select&lt;/option&gt; &lt;option value="2whlr"&gt;2 Wheeler&lt;/option&gt; &lt;option value="2whlr"&gt;4 Wheeler&lt;/option&gt; &lt;option value="2whlr"&gt;4 Wheel Drive&lt;/option&gt; &lt;/select&gt;&lt;/td&gt; &lt;td&gt;Make&lt;/td&gt; &lt;td&gt; &lt;select name="vehicle-make"&gt; &lt;option value="0"&gt;....&lt;/option&gt; &lt;option value="1"&gt;....&lt;/option&gt; . . . &lt;/select&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Model&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="make-model" /&gt;&lt;/td&gt; &lt;td&gt;Year&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="make-year" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/fieldset&gt; . . . . &lt;input type="submit" name="submit" value="Submit" /&gt; </code></pre> <p></p> <p>When I try to submit the form, it redirects to <code>controller/index.php</code> rather than <code>controller/register.php</code><br/> When I rename <code>register.php</code> file to <code>index.php</code> then the firefox gives the following error: <br/><br/></p> <blockquote> <p><strong>The page isn't redirecting properly</strong><br/> Firefox has detected that the server is redirecting the request for this address in a way that will never complete.<br/><br/> This problem can sometimes be caused by disabling or refusing to accept cookies.</p> </blockquote> <p><br/><br/> 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? </p>