Re: PHP讀檔案問題
※ 引述《p0918311874 (小皓)》之銘言:
: 小弟我選修了一門課,叫做網路學習導論,老師買的課本教一點 HTML
: 和 PHP 和 MySQL 和 ajax ~"~ 因為都沒教很深(很多東西都沾上一點) 所以
: 都是講過概念的教法,寫作業就不是很懂 一些 php函數 (讀檔)
: 我們是把 次服器架在 USB 裡面 Apach2 老師要我們設計一個PHP程式,可以
: 產生一個框框 讓他按瀏覽USB裡面的文字檔 並且一行一行印出來
: 我是用USB開機的^^ 資料庫和server都是灌在 USB
: 以下是我的程式碼 ~"~ 我的php只學 幾天 =.=
: //檔名 hw.php 網址: http://www.localhost/hw.php( 在我usb裡=.=)
: <?php
: header('content-type:text/html;charset=utf-8');
: <form action="hw.php" method="post" enctype="multipart/form-data">
: <input type="file" name="UpFile"> <br/>
: <input type="submit" value="送出">
: $file=fopen(" file source " ,"r")
: echo $file;
: ?>
: 請問各位前輩 , 我這樣解對嗎? 我去run 都有錯 =.=|
: 如果有不當的地方 我會自 d 謝謝!
給你幾個方向去看看
file()
http://linux.tnc.edu.tw/techdoc/banic/filesystem/file.html
file_get_contents()
http://www.php5.idv.tw/modules.php?mod=books&act=show&shid=198
:) 既然是作業,就辛苦點,多做測試
--
歡迎來我的網誌看看
@ http://doublekai.org/blog
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.240.37.127
討論串 (同標題文章)
PHP 近期熱門文章
PTT數位生活區 即時熱門文章
-3
10