>> //080122 if(!isset($incho)){ $incho = $_POST['incho']; } if(!isset($time)){ $time = $_POST['time']; } if(!isset($day)){ $day = $_POST['day']; } //=====ADD end <<< if(!isset($msg)){ $msg = $_POST['msg']; } if(!isset($date)){ $date = $_POST['date']; } if(!isset($button)){ $button = $_POST['button']; } if(!isset($password)){ if($_POST['password']){ $password = $_POST['password']; }else{ $password = $_GET['password']; } } if(!isset($e_code)){ $e_code = $_POST['e_code']; } if(!isset($upfile)){ $upfile = $_FILES['upfile']['tmp_name']; } if(!isset($upfile_name)){ $upfile_name = $_FILES['upfile']['name']; } if(!isset($pline)){ $pline = $_POST['pline']; } if(!isset($sort_flag)){ $sort_flag = $_POST['sort_flag']; } //エスケープ記号対策 $subject = stripslashes($subject); //=====ADD start >>> //080122 $incho = stripslashes($incho); $time = stripslashes($time); $day = stripslashes($day); //=====ADD end <<< $msg = stripslashes($msg); //===============インライン関数=================== function inline_link($link){ $link = ereg_replace("(https?|ftp|news)(://[[:alnum:]\+\$\;\?\.%,!#~*/:@&=_-]+)","\\1\\2",$link); return $link; } if($action == "regist"){ //処理の分岐 if($button == "修正/更新"){ //ここから書き込みデータの調整 $subject = htmlspecialchars($subject); //=====ADD start >>> //080122 if(!$tag_flag){ $incho = htmlspecialchars($incho); } //タグの調整 //080122 $incho = nl2br($incho); //080122 $incho = str_replace("\r", "", $incho); //080122 $incho = str_replace("\n", "", $incho); if(!$tag_flag){ $time = htmlspecialchars($time); } //タグの調整 $time = nl2br($time); $time = str_replace("\r", "", $time); $time = str_replace("\n", "", $time); if(!$tag_flag){ $day = htmlspecialchars($day); } //タグの調整 $day = nl2br($day); $day = str_replace("\r", "", $day); $day = str_replace("\n", "", $day); //=====ADD end <<< // if(!$tag_flag){ $msg = htmlspecialchars($msg); } //タグの調整 $msg = nl2br($msg); $msg = str_replace("\r", "", $msg); $msg = str_replace("\n", "", $msg); //ログファイルの区切文字(",")と区別するために文字コード(,)に書き換える。 $subject = str_replace(",", ",",$subject); //=====ADD start >>> //080122 $incho = str_replace(",", ",",$incho); $time = str_replace(",", ",",$time); $day = str_replace(",", ",",$day); //=====ADD end <<< $msg = str_replace(",", ",",$msg); //インラインリンクを実現(URLのみ) //=====ADD start >>> //080122 $incho = inline_link($incho); $time = inline_link($time); $day = inline_link($day); //=====ADD end <<< $msg = inline_link($msg); //画像のアップロード処理 if(is_uploaded_file($upfile)){ //画像の属性を取得 $imagesize = getimagesize($upfile); //大きな画像のアップを制限 if(($imagesize[0] > $w_limit) || ($imagesize[1] > $h_limit)){ $err_flag = 1; echo ""; exit; }else{ switch($imagesize[2]){ case 1: $out = $code . ".gif"; break; case 2: $out = $code . ".jpg"; break; case 3: $out = $code . ".png"; break; default: unlink($upfile); } if($out){ $sendpath = $path.$out; if(move_uploaded_file($upfile, $sendpath)){ chmod($sendpath,0666); $fname = $out; } } } } $repdata = file($data_file); $fp = fopen($data_file, "w"); for($i=0; $i\n"; exit; }elseif($button == "削除"){ $deldata = file($data_file); $fp = fopen($data_file, "w"); for($i=0; $i>> //080122 if(!$tag_flag){ $incho = htmlspecialchars($incho); } //タグの調整 //080122 $incho = nl2br($incho); //080122 $incho = str_replace("\r", "", $incho); //080122 $incho = str_replace("\n", "", $incho); if(!$tag_flag){ $time = htmlspecialchars($time); } //タグの調整 $time = nl2br($time); $time = str_replace("\r", "", $time); $time = str_replace("\n", "", $time); if(!$tag_flag){ $day = htmlspecialchars($day); } //タグの調整 $day = nl2br($day); $day = str_replace("\r", "", $day); $day = str_replace("\n", "", $day); //=====ADD end <<< // if(!$tag_flag){ $msg = htmlspecialchars($msg); } //タグの調整 $msg = nl2br($msg); $msg = str_replace("\r", "", $msg); $msg = str_replace("\n", "", $msg); //ログファイルの区切文字(",")と区別するために文字コード(,)に書き換える。 $subject = str_replace(",", ",",$subject); //=====ADD start >>> //080122 $incho = str_replace(",", ",",$incho); $time = str_replace(",", ",",$time); $day = str_replace(",", ",",$day); //=====ADD end <<< $msg = str_replace(",", ",",$msg); //インラインリンクを実現(URLのみ) //=====ADD start >>> //080122 $incho = inline_link($incho); $time = inline_link($time); $day = inline_link($day); //=====ADD end <<< $msg = inline_link($msg); //画像のアップロード処理 if(is_uploaded_file($upfile)){ //画像の属性を取得 $imagesize = getimagesize($upfile); //大きな画像のアップを制限 if(($imagesize[0] > $w_limit) || ($imagesize[1] > $h_limit)){ $err_flag = 1; echo ""; exit; }else{ switch($imagesize[2]){ case 1: $out = $code . ".gif"; break; case 2: $out = $code . ".jpg"; break; case 3: $out = $code . ".png"; break; default: unlink($upfile); } if($out){ $sendpath = $path.$out; if(move_uploaded_file($upfile, $sendpath)){ chmod($sendpath,0666); $fname = $out; } } } } //ログファイルの区切文字(",")と区別するために文字コード(,)に書き換える。 $fname = str_replace(",", ",",$fname); //配列要素を文字列により連結 $input_msg = implode(",", array($code,$subject,$incho,$msg,$time,$day,$fname,$date)); $message = file($data_file); $fp = fopen($data_file, "w"); rewind($fp); fputs($fp, "$input_msg\n"); //最大記録数の調整 if($data_max <= count($message)){ $msg_num = $data_max - 1; }else{ $msg_num = count($message); } for($i = 0; $i < $msg_num; $i++){ fputs($fp, $message[$i]); } fclose($fp); unset($message); echo "\n"; } } }elseif(($action == "edit") && ($password == $passwd)){ $kanri_flag = 1; echo "
\n"; // echo "

記事の並び:\n"; if($e_code < 1) { echo "\n"; echo "\n"; // echo "\n"; //080122 echo "\n"; //080122 echo "\n"; echo "\n"; // echo "\n"; // echo "\n"; // echo "\n"; // echo "\n"; // echo "\n"; echo "
日付:
日付:
タイトル:
内容:
電話番号:
電話番号:
FAX番号:
FAX番号:
添付画像:
\n"; echo "

\n"; }else{ $comdata = file($data_file); for($i=0; $i", "\n", $cincho); $e_incho = strip_tags($e_incho); $e_msg = str_replace("
", "\n", $cmsg); $e_msg = strip_tags($e_msg,"

"); $e_time = str_replace("
", "\n", $ctime); $e_time = strip_tags($e_time); $e_day = str_replace("
", "\n", $cday); $e_day = strip_tags($e_day); $e_date = $cdate; $e_fname = $cfname; break; } } unset($comdata); //echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; // echo "\n"; //080122 echo "\n"; //080122 echo "\n"; echo "\n"; // echo "\n"; // echo "\n"; // echo "\n"; // echo "\n"; // echo "\n"; echo "\n"; echo "\n"; echo "
日付:
日付:
タイトル:
内容:
電話番号:
電話番号:
FAX番号:
FAX番号:
添付画像:
\n"; echo "
\n"; } } //エラー処理 if($err_flag){ echo $err_msg; echo "

<やり直す>\n"; exit; } $message = file($data_file); $msg_count = count($message); if($sort_flag){ $log_max = $msg_count - 1; for($i=$log_max; $i>=0; $i--){ $message2[] = $message[$i]; } } if($pline == ""){ $p_line = 0; }else{ $p_line = $pline; } $end_data = $msg_count - 1; $page_end = $p_line + ($page_view - 1); if($page_end >= $end_data) $page_end = $end_data; for($i = $p_line; $i <= $page_end; $i++){ if($sort_flag){ list($vcode,$vsubject,$vincho,$vmsg,$vtime,$vday,$vfname,$vdate) = split( ",", $message2[$i]); }else{ list($vcode,$vsubject,$vincho,$vmsg,$vtime,$vday,$vfname,$vdate) = split( ",", $message[$i]); } echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; // echo "\n"; echo "
\n"; //訂正モード判定 if (($action == "edit") && ($password == $passwd)) { //訂正時はボタンを訂正ボタンを表示する echo "\n"; } echo ""; //日付 //080122 echo "\n"; //080122 echo ""; //080122 echo ""; //氏名 //080122 echo "\n"; //080122 echo ""; //内容 echo ""; echo "\n"; echo ""; /* echo ""; echo "
"; echo "";*/ echo "
$vsubject
■ $vincho
$vmsg
"; echo "
\n"; } ?>

= $page_view){ $page_count = floor($page_end / $page_view); $prev_line = ($page_count - 1) * $page_view; echo "
\n"; if (($action == 'edit') && ($password == $passwd)){ echo "\n"; echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "
\n"; }else{ echo " \n"; } ?>

\n"; if (($action == 'edit') && ($password == $passwd)){ echo "\n"; echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; }else{ echo " \n"; } ?>


\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; } ?>