Home  >  Article  >  Backend Development  >  What should I do if the form cannot be submitted to php?

What should I do if the form cannot be submitted to php?

藏色散人
藏色散人Original
2022-12-01 09:08:516102browse

Solution to the form that cannot be submitted to PHP: 1. Open the corresponding code file; 2. Modify the "onload="javascript:document.form1.submit();" statement; 3. Change the name of submit Just make some changes.

What should I do if the form cannot be submitted to php?

The operating environment of this tutorial: Windows 7 system, PHP version 8.1, Dell G3 computer.

What should I do if the from form cannot be submitted to php?

The solution to the problem that the form cannot be automatically submitted to php using html

When writing a web security range, you need to Automatic form submission is used.

<body onload="javascript:document.form1.submit();">
<h2>管理员后台登陆界面</h2>
<form action="login.php" method="post" name="form1" id="form1">
用户名:<input type="text" name="name" value="{$name}" hidden><br>
密码:<input type="password" name="password" value="{$password}" hidden><br>
<input type="text" name="step" value="2" hidden>
<input type="submit" name="sub" value="登陆" hidden>
</form>
</body>

After checking some information, I used the above method to complete the method of automatically submitting the form. By the way, I also saw a friend saying that you can write an automatic submission form locally and you can do it. Some websites have "no need to log in".

I stepped on a trap and found out after checking for a long time.

First onload="javascript:document.form1.submit();" this statement The form1 must be consistent with the name attribute in the ff9c23ada1bcecdd1a0fb5d5a0f18437 form.

Another point is that when using this automatic submission form submit(), the attribute name=submit is not allowed, so I will submit Change the name to another name sub, just change this.

Recommended study: "PHP Video Tutorial"

The above is the detailed content of What should I do if the form cannot be submitted to php?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn