[在另一个HTML文件中提交按钮时运行php文件

问题描述 投票:0回答:1

从去年开始,我就开始通常将html,php和css编码为一种爱好。我已经创建了5页的网站并也进行了托管。现在,我想进行注册过程,在Google和Youtube的帮助下,我创建了“ Signing-Sing-up”页面,并带有切换选项,但是一旦用户在登录时提供注册信息,便无法运行registration.php文件.html文件。代码如下:

<form id="login" class="input-group">
    <input type="text" class="input-field" placeholder="User Id" required>
    <input type="password" class="input-field" placeholder="Enter Password" required>
    <input type="checkbox" class="check-box"><span>Remember Password</span>
    <button type="submit" class="submit-btn">Sign-In</button>
</form>

<form Id="register" class="input-group">
    <input type="text" class="input-field" placeholder="User Id" required>
    <input type="email" class="input-field" placeholder="Email Id" required>
    <input type="password" class="input-field" placeholder="Enter Password" required>
    <input type="password" class="input-field" placeholder="Confirm Password" required>
    <input type="phone-number" class="input-field" placeholder="Mobile Number" required>
    <input type="checkbox" class="check-box"><span>I agree to the terms & conditions</span>
    <button type="submit" class="submit-btn">Sign-Up</button>
</form>

[在登录按钮上单击login.html文件时,什么代码适合执行registration.php文件,请您帮我一下。登录选项也是如此。在此先感谢您的帮助。问候,[Shuk

php html toggle execute
1个回答
0
投票

方法属性指定如何发送表单数据(将表单数据发送到操作属性中指定的页面)。>>

表单数据可以作为URL变量(通过method =“ get”发送)或作为HTTP post transaction(通过method =“ post”)发送。

<form id="login" class="input-group" method="POST" action="login.php">
    <input type="text" class="input-field" placeholder="User Id" required>
    <input type="password" class="input-field" placeholder="Enter Password" required>
    <input type="checkbox" class="check-box"><span>Remember Password</span>
    <button type="submit" class="submit-btn">Sign-In</button>
</form>

<form Id="register" class="input-group" method="POST" action="register.php">
    <input type="text" class="input-field" placeholder="User Id" required>
    <input type="email" class="input-field" placeholder="Email Id" required>
    <input type="password" class="input-field" placeholder="Enter Password" required>
    <input type="password" class="input-field" placeholder="Confirm Password" required>
    <input type="phone-number" class="input-field" placeholder="Mobile Number" required>
    <input type="checkbox" class="check-box"><span>I agree to the terms & conditions</span>
    <button type="submit" class="submit-btn">Sign-Up</button>
</form>
© www.soinside.com 2019 - 2024. All rights reserved.