gpt4 book ai didi

javascript - 提交隐藏表单字段

转载 作者:行者123 更新时间:2023-11-28 01:51:18 25 4
gpt4 key购买 nike

我们最近从 ASP 切换到 PHP,我们曾经有一个包含自动字段的表单,用于使用名为 <!--#include file="XXX.inc" --> 的文件登录用户。 .

有没有办法使用 php 来做同样的事情?如果没有,我可以使用 JavaScript 或 JQuery 吗?

只有两个字段:用户名用户密码

我们使用的代码是:

<form method="post" action="http://www.example.com" target="_self">
<!--#include file="bslogin.inc" -->
<input type="image" name="btn_login" src="../images/GoDatabase_off.jpg" alt="Go to the Database" width="125" height="38" border="0">

两者均由 .inc 文件提供。

感谢您的帮助。

最佳答案

本质上是一样的,但您将使用以下方法包含该文件:

include('bslogin.inc'); 

您的 HTML 有

<input type="hidden" name="username" value="xxx" />
<input type="hidden" name="password" value="xxx" />

PHP 在 $_POST 中将其视为 $_POST['username']

关于javascript - 提交隐藏表单字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19670479/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com