08/09/26 17:06:55
>>115
かなりの初心者のようだな
>>114のソースだと、ボタンを押さなくても必ずファイルへ書き込んどる(textboxが空だからファイルも空)
せめてisset($_POST['textbox'])でもいいからボタンを押したことを判別して書き込みを行ってくれ
それと書き込みと読み込みを別けてくれ
<?php
$filepath = "777.txt";
if(isset($_POST['textbox'])){
$text = htmlspecialchars( $_POST["textbox"] );
if ( get_magic_quotes_gpc() ) {
$text = stripslashes( $text );
}
$string = "$text\n";
$fp = fopen($filepath, "w");
@fwrite( $fp, $string, strlen($string) );
fclose($fp);
}
readfile($filepath);
?>