$config没有任何东西,file_get_contents抓取的是HTML,程序源码是不能抓取的,抓取的是源码解析后的内容

解决方案 »

  1.   

    file_get_contents
    用来读取一个档案的内容(本地及网络都可以)$config 是存了什么东西?
      

  2.   

    <?php
        $dbhost = 'localhost';
        ......
    ?>
    类似这样的配置信息 我现在要在后台修改这些配置信息 应该怎么整啊!
      

  3.   

    $config应该改成配置档案的路径
      

  4.   

    $config 现在就是配置文件的路径?
      

  5.   

    哪要看你$config这个配置文件是如何写的.string(86) 说明,还是取到文件内容了,长度为86.
    查看右键能看到源码,如果字符串非空的话.
      

  6.   

    例子:
    <?php
        $dbhost = 'localhost';
        $dbuser = 'root';
        $dbpass = '';
        $dbname = 'test';
    ?>这是config.php 文件$sitefile = dirname(__FILE__)."/config.php";$content = file_get_contents($sitefile);
    我就这个意思!我就是想得到这个源文件 例如有个表单 直接修改表单 就可以更改配置文件里的选项!
      

  7.   

    echo $sitefile = dirname(__FILE__)."/config.php"; 
    $content = file_get_contents($sitefile);
    echo "<pre>".htmlspecialchars($content)."</pre>";已经成功取得了,浏览器隐藏了而已
      

  8.   

    <?php
    $dbconnect_file = file_get_contents("./dbconnect.php");
    echo $dbconnect_file;
    ?>
    dbconnect.php代码如下:<?php
    ob_start(); 
    mysql_connect("localhost", "root", "");
    mysql_query("set names 'gb2312'");
    if(!@mysql_select_db("zrpg"))
    {
    header("location:install.php");
    exit;
    }
    if(isset($_COOKIE[username]))
    $username = $_COOKIE[username];
    else
    $username = GetIP();header('Content-Type:text/html;charset=GB2312');
    ?>经测试,可以抓取到,查看页面源代码可以看到内容.
      

  9.   


    只要路径正确,就肯定能获取到,要看是否查看到,就要看HTML源代码。
      

  10.   

    直接include就可以了,为啥还要file_get_contents呢.
    呵呵.
      

  11.   


    呵呵,没看清楚哦。
    楼主不是像include,而是想修改里面的配置,看8楼的。
    哈哈