Creating Files !

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
phpbeginer
Forum Newbie
Posts: 8
Joined: Sun Feb 15, 2004 1:24 am

Creating Files !

Post by phpbeginer »

Hi,
This is me again..

Is it possible to let php code writes on the client side.. I've written a code which asks users to fill up some fields and then the code should creates a file with the data they filled under their c: drive. What happened to me, the data were filled ok but the file was created under the server c: drive?


I hope the question is clear! and please ask for any clarifications if requires..

Regards.
phpbeginer
Forum Newbie
Posts: 8
Joined: Sun Feb 15, 2004 1:24 am

Post by phpbeginer »

Please, I need your urgent help....
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

You can't write direct to a clients harddrive, this would be a Very Bad Thing[TM] if you could.
What you can do though is create the file on the server and offer that file as a download to the client (so a box pops up saying Open, Save Cancel etc..). If this is ok then see http://php.net/header around the line starting with "If you want the user to be prompted to save the data you are sending...."
phpbeginer
Forum Newbie
Posts: 8
Joined: Sun Feb 15, 2004 1:24 am

Post by phpbeginer »

Yes, it is a bad thing to write on the client machine! That would make hacking very easy through PHP ;)

I Think what you suggested is really what I need, I just finished writing the batch file that will ask the user about some information and store it in his harddrive. I will use the download link to allow user run the batch from his side...

Thanks a lot Mark..
Post Reply