真心不明白怎么回事,代码如下
<?php
if(file_exists('perform.php'))
echo '3';
include 'perform.php';
echo "hi1";
if(isset($_POST['target']))perform($_POST['target']);
?>
perform.php文件是存在的,但是页面显示3,不显示hi1
求大神……!!

解决方案 »

  1.   

    <?php
    if(!file_exists('perform.php'))
    echo '3';
    include 'perform.php';
    echo "hi1";
    if(isset($_POST['target']))perform($_POST['target']);
    ?>
      

  2.   

    问题不是这个啊&……
    主要是下面的include语句后面的语句不执行啊……
      

  3.   

    问题在于……include下面的语句没有执行啊……
      

  4.   

    那就要把perform.php的代码贴出来看看啊,会不会已经exit了
      

  5.   

    <?php
    function perform($post){
    echo "hi";
    $conn=mysql_connect("localhost","plantSelectUser",null);
    mysql_select_db("test");
    mysql_query("SET NAMES 'utf8'");
    $result=mysql_query("select * from test where CnName='".$post."';");
    foreach($bar as mysql_fetch_array($result))
    echo '<div class="bar"><div class="text"><div class="title">'.$bar['Cn'].'</div>'.mysql_fetch_array(mysql_query($bar['La']))['formation'].'</div>';
    if(file_exists('./DataXML/'.$bar['La'].'/photos.xml'))$photo=simplexml_load_file('./xml/ftpManager.xml');
    echo'<img src="'.$photo->path[0].'">';
    echo'</div>';
    mysql_close($conn);
    }
    ?>
    应求发……估计是出不来什么错误……
      

  6.   

    你怎么确定没执行的。查看源码就知道了。注释掉include是什么情况
      

  7.   


    foreach($bar as mysql_fetch_array($result))
    反了foreach(mysql_fetch_array($result) as $bar)
      

  8.   

    你看,本来有个echo "hi1",但是这句话没有实现……
      

  9.   

    这确实是错误……但是改了以后仍然没用……
    我觉得问题仍然在include那里……
      

  10.   


    问题还是在你这个包含文件里,即使只是函数没有被执行,但是有一个地方出错也会导致include出错的,继续找找其他地方有没有语法错误吧,跟着错误提示走就行了