【PHP】質問スレッドpart20【php】
■ このスレッドは過去ログ倉庫に格納されています
0562552
04/08/18 16:42ID:???<?php
if ($action == "投稿"){
$mynews = 'page/〜/data.cgi';
$file = file($mynews);
$count = count($file);
if ($count > 10){
$count = 10;
}
$host = getenv("REMOTE_HOST");
$addr = getenv("REMOTE_ADDR");
if($host == "" || $host ==$addr){
$host = gethostbyaddr($addr);
}
list ($name2,$url2,$title2,$comment2,$host2) = split( ",", $file[0]);
if ($host != $host2 && $url != url2){
$input = implode(",", array($name,$url,$title,$comment,$host));
$fp = fopen($mynews, "w");
flock($fp,LOCK_EX);
rewind($fp);
fputs($fp, "$input\n");
for($i = 0; $i < $count; $i++){
fputs($fp, $file[$i]);
}
flock($fp,LOCK_UN);
fclose($fp);
unset($file);
}
header ("Location:http://〜/index.php");
}
?>
■ このスレッドは過去ログ倉庫に格納されています