Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用查询字符串获取文件内容,以获取特定id的数据_Php_Mysql_Curl - Fatal编程技术网

Php 使用查询字符串获取文件内容,以获取特定id的数据

Php 使用查询字符串获取文件内容,以获取特定id的数据,php,mysql,curl,Php,Mysql,Curl,我有两个文件,register.php和query.php。我需要类似于register.php页面的功能,我可以显示特定id的数据,该id在query.php中处理 register.php query.php 我必须显示数据库中所有id的数据。我不知道如何获取特定id的数据(可能会有所不同),并在register.php页面上显示 有人能帮我吗 file_get_contents不会得到页面输出,它会得到文件的内部内容,比如php/html。您可能需要使用cURL@Diyar Baban:我

我有两个文件,register.php和query.php。我需要类似于register.php页面的功能,我可以显示特定id的数据,该id在query.php中处理

register.php

query.php

我必须显示数据库中所有id的数据。我不知道如何获取特定id的数据(可能会有所不同),并在register.php页面上显示


有人能帮我吗

file_get_contents不会得到页面输出,它会得到文件的内部内容,比如php/html。您可能需要使用cURL@Diyar Baban:我是cURL新手。在上面的情况下,我如何使用它呢?在php的文档中,几乎有所有关于cURL的知识
echo file_get_contents('query.php?id=1');  
echo file_get_contents('query.php?id=2'); 
.
.
echo file_get_contents('query.php?id=14'); 
echo file_get_contents('query.php?id=15');
if (isset($_GET['id'])) {
$id = $_GET['id'];
switch ($id) {
    case 1:
    $query1 = mysql_query("select * from tblname where id=$id");
while ($row1 = mysql_fetch_array($query1)) {
            $file = $row1['type'];
            $file_type_name = "qsg";
            $header = $row1['title'];
            $paragraph_description =  $row1['description'];
            include '../../../print.php';
}
       // break;
    case 2:
    $query1 = mysql_query("select * from tblname where id=$id");
while ($row1 = mysql_fetch_array($query1)) {
                $file_type = $row1['type'];
                $file_name = "email_intro";
                $header = $row1['title'];
                $abstract = $row1['description'];
                include '../../../email.php';
}
      // break;

// default:
//        echo "other";

}
}