检索用户在html中从发送请求到另一个php的php输入的特定数据
I am designing a restful web app to access mysql database's table. The flow of the process i am intending is like this, user fills form and submit to php then from that php it will send request to another php which will then print out the specific data.
It contain of 3 files:
- form in html
- client in php
- server in php
So far i have manage to pass the data entered by user in html form to client PHP using if(isset($_GET["input"]
.
Before i go any further i have a question, is it possible to pass a user input variable from a php to another php using $request = file_get_contents? if so, could you please enlighten me with the right ways.
Much regards, fellow stackoverflow user
我正在设计一个安静的Web应用程序来访问mysql数据库的表。 我想要的流程是这样的,用户填写表单并提交给php,然后从php发送请求到另一个php,然后打印出特定的数据。 p>
它包含3个文件: p>
- 在PHP
中的html
-客户端中的表单
code> code> pre>
到目前为止,我已设法使用 if(isset($ _ GET [“input”] code>)将用户以html格式输入的数据传递给客户端PHP。 p>
在我再进一步之前我有一个问题,是否可以使用$ request = file_get_contents将用户输入变量从php传递到另一个php?如果是这样,请你以正确的方式启发我。 p>
很多问候,
fellow stackoverflow用户 p>
div>
You would not be able to execute localy like this
file_get_contents('path/to/file.php');
Bud you can bypass this by making http call
file_get_contents('http://yourdomain.com/file.php?input='.$_GET['input']);
Bud it is not recomended.. Is there any specific reason you have to call the second script?