开发者

All my forms submit to the same script

I'm programming a webpage and in my index, I have two forms.

The 1st is for the login:

<form method="post" action="login.php">...</form>

The 2nd is for search:

<开发者_如何学Cform method="post" action="search.php">...</form>

My problem is that when I submit the search form, it works as if the action is targeting login.php. When I see the source code, the tag <form method="post" action="search.php"> doesn't appear.


The most probable cause of the problem is incorrectly nested forms or missing closing form for login form. Check the generated HTML for the validity of the HTML and if not post the generated HTML so that we can help you debug.


It is hard to tell without seeing the complete page, but I would guess that you have one form inside the other — which is forbidden. You cannot nest forms.


Turns out I didn't really close the form tags, I typed <form> instead of </form>. Sorry.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜