运行PHP文件在按钮单击 [英] Run PHP File On Button Click

查看:79
本文介绍了运行PHP文件在按钮单击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道是否有人可以帮我请。

I wonder whether someone could help me please.

我一直在寻找通过这个,和许多其他网站和教程,了解如何将按钮添加到打开一个PHP文件形式,在这种情况下,一个弹出表单,允许用户上传文件到MySQL数据库。

I've been looking through this, and many other sites and tutorials to find out how to add a button to a form which opens a PHP file, in this case, a pop up form that allows a user to upload a file to a mySQL database.

在除了文件的开放,我想从主窗体弹出文件上传的形式进行过ID字段值。

In addition to the opening of the file, I'd like to carry over the 'id' field value from the main form to the pop 'File Upload' form.

从我开展这项研究似乎有一些方法可以做到这一点,但是从初学者的角度来看,我不知道什么是做到这一点的最好办法。

From the research I've carried out there seems to be a number of ways to do this, but from a beginners perspective I'm not sure what is the best way to do this.

可能有人或许请告知什么是去是最好的方法。

Could someone perhaps please advise on what is the best way to go about this.

许多的感谢和亲切的问候

Many thanks and kind regards

推荐答案

要在页面之间传递值:

主要形式有:

<form action="myuploadform.php" method="get">
ID: <input type="text" name="id">
<input type="submit" value="Open Form">
</form>

ID文本框中的值会随着 $ _ GET ['身份证'] myuploadform.php 。

使用 GET 参数是值传递的最简单的方法。在这个 GET 值传递另一种方式是在网址:

Using GET parameters is the simplest way of passing values. Another way to pass in this GET value would be in the URL:

... / myuploadform.php?ID = 35 ,其中ID就变成了35。

.../myuploadform.php?id=35 where the ID then becomes 35.

这篇关于运行PHP文件在按钮单击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆