[請益] 無法把textbox的資料寫進txt檔

看板PHP作者 (行善的快樂)時間15年前 (2009/03/04 20:09), 編輯推噓0(002)
留言2則, 1人參與, 最新討論串1/1
大家好,我有一個php寫入檔案的問題想跟大家請教, 我可以用語法把txt檔案建立起來,但卻無法把上一頁textbox裡的資料寫入txt檔裡, 不知道是語法中哪裡出了問題? 謝謝 <?php $theText = stripslashes($Text) . "\n"; if (strlen($theText) > 10) { $filename = "./Texts/$ip"."_"."$Sex".time().".txt"; if (file_exists($filename)) { echo "The file $filename already exists. Delete it."; } else { touch($filename); $file = fopen($filename, "w"); flock($file,LOCK_SH); fputs($file, $theText); flock($file, LOCK_UN); fclose($file); fclose($handle); unlink($outfile); } } ?> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 219.84.89.150

03/04 20:24, , 1F
檢查你的$Text是不是空的
03/04 20:24, 1F

03/04 20:24, , 2F
還有你有沒有忘了用$_GET, $_POST
03/04 20:24, 2F
文章代碼(AID): #19hczs2q (PHP)