×

Loading...
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务

a php trouble

本文发表在 rolia.net 枫下论坛hi there guru,
my code can create a sub dir successfully:

[
echo" <tr>\n";
echo" <td colspan=\"2\">Create user dir";
if(@mkdir("$config[data]/$user",0777)) {
@chmod("$config[data]/$user",0777);
echo$correct;
}else
echo$incorrect;
]

but following code can set up files in this new dir, why? i think this code has no question, i am douting the server configuration, who can point the troubles out.

[

$items2check=array("agent","click","day","detail","hour","month","pageview","start");

for($i=0;$i<7;$i++) {
echo" <tr>\n";
echo" <td colspan=\"2\">Initialization $items2check[$i].dat";
$filename="$config[data]/$user/$items2check[$i].dat";
$fp=@fopen($filename,"w");
@flock($fp,3);
if(@fwrite($fp," ")) {
echo$correct;
}else {
echo$incorrect;
$error="User system can't be initialized,please contact webmaster";
}
@fclose($fp);
@chmod($filename,0777);
}
]更多精彩文章及讨论,请光临枫下论坛 rolia.net
Report

Replies, comments and Discussions:

  • 工作学习 / IT技术讨论 / a php trouble
    本文发表在 rolia.net 枫下论坛hi there guru,
    my code can create a sub dir successfully:

    [
    echo" <tr>\n";
    echo" <td colspan=\"2\">Create user dir";
    if(@mkdir("$config[data]/$user",0777)) {
    @chmod("$config[data]/$user",0777);
    echo$correct;
    }else
    echo$incorrect;
    ]

    but following code can set up files in this new dir, why? i think this code has no question, i am douting the server configuration, who can point the troubles out.

    [

    $items2check=array("agent","click","day","detail","hour","month","pageview","start");

    for($i=0;$i<7;$i++) {
    echo" <tr>\n";
    echo" <td colspan=\"2\">Initialization $items2check[$i].dat";
    $filename="$config[data]/$user/$items2check[$i].dat";
    $fp=@fopen($filename,"w");
    @flock($fp,3);
    if(@fwrite($fp," ")) {
    echo$correct;
    }else {
    echo$incorrect;
    $error="User system can't be initialized,please contact webmaster";
    }
    @fclose($fp);
    @chmod($filename,0777);
    }
    ]更多精彩文章及讨论,请光临枫下论坛 rolia.net
    • nobody knows?