Reading windows files and folders using php scripts?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Dark-Rival
Forum Newbie
Posts: 21
Joined: Thu Apr 15, 2004 5:03 am
Location: Amsterdam

Reading windows files and folders using php scripts?

Post by Dark-Rival »

I kind of have a big problem on my hands here. I have to make an entire website in the ASP language, which I'm not familier with at all. I've got some PhP experience, but there is still much left to learn.

I'm going to try to make this in PHP style, but now I have a couple of questions, I hope you can help me.

Is it possible to list files in a normal windows folder on a website using php a php script? So use the windows folder as the database.

If so, is it possible to read files using php like .txt files?

And is it also possible to delete or move files in a windows folder?

Very complicated stuff, I just need to know if this isn't a waste of time ^^
Thnx in advance.
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Yep its all possisble, check out the filesystem manual page on php.net - http://uk.php.net/manual/en/ref.filesystem.php
dipit
Forum Newbie
Posts: 12
Joined: Thu Apr 08, 2004 2:36 am
Location: india
Contact:

try this

Post by dipit »

hi Dark,

Q1 Is it possible to list files in a normal windows folder on a website using php a php script?
:idea: Try this Dir
$d = dir("/etc");
echo "Handle: ".$d->handle."<br>\n";
echo "Path: ".$d->path."<br>\n";
while (false !== ($entry = $d->read())) {
echo $entry."<br>\n";
}
$d->close();

Q2.is it possible to read files using php like .txt files?
:idea: Yes.
int readfile ( string filename [, bool use_include_path])

Q3. Is it also possible to delete or move files in a windows folder?
:idea: Try this int unlink ( string filename)



Waiting 4 ur kind response
dipit
User avatar
Dark-Rival
Forum Newbie
Posts: 21
Joined: Thu Apr 15, 2004 5:03 am
Location: Amsterdam

Post by Dark-Rival »

This is very very usefull stuff :D Thnx a lot guys!
Post Reply