论坛首页 编程语言技术论坛

php页面框架内echo无法输出文字,也无法输出到硬盘上的txt文件

浏览 3317 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2016-05-31  
PHP
php页面框架内echo无法输出文字,也无法输出到硬盘上的txt文件,这是为什么呢?
是大幅改造后的ecshop后台,最上面一个横的菜单,下面左侧一列菜单,下面右侧就是我说的框架。
   发表时间:2016-05-31  
[code=php]
<?php
define('IN_ECS', true);
require(dirname(__FILE__) . '/includes/init.php');
require_once(ROOT_PATH . 'includes/lib_order.php');
... ...
if ($_REQUEST['act'] == 'operate'){
    atxt('ok');
    echo('ok');
... ...

function atxt($txt='')   
{    
        $filename = 'a.txt';
        $somecontent = $txt;

        if (is_writable($filename)) {
            if (!$handle = fopen($filename, 'w')) {
                 exit;
            }       
            if (fwrite($handle, $somecontent) === FALSE) {
                exit;
            }          
            fclose($handle);       
        }
}
0 请登录后投票
   发表时间:2016-05-31  
真想不通,请各位帮忙指点一下,十分感谢!
0 请登录后投票
   发表时间:2016-09-26  
micccn 写道
真想不通,请各位帮忙指点一下,十分感谢!

你可以写几个else ,或者打印下你的变量,实在不行的话,就用file_put_contents() 函数来处理。
0 请登录后投票
论坛首页 编程语言技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics