本文发表在 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
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