file access problems

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
d52477001
Forum Newbie
Posts: 6
Joined: Sun Jan 11, 2004 8:21 am
Location: Gaborone, Botswana

file access problems

Post by d52477001 »

Hello everyone,

Got a slight problem with writing to a file. I'll try to explain as clearly as i can:

I want to write some code to write to a file. I managed this without a problem using the fwrite() function. Now there are two places where i host files. One of them is on a server of someone i know. To connect to this i go through the ftp. here i changed the eccess rights of the file i wanted to write to and it worked without problem.
Now, there is a second place where i want to host this site. It's on the university network, so i do not use ftp, i just connect to the network and put files in a certain folder. Here, however, when i try to write to the file, i get a file access error. When i try to change the access rights, it is through the windows->properties dialog. Yet, even if i give full file premission, it still gives an access error.
So, i thought i was clever and i tried to write to the file on the 1st server i mentioned. Yet, then i get this error:

HTTP wrapper does not support writeable connections

So my question is, is there perhaps another way to change access rights so that i can write to the file on the university server, or is there perhaps another way i can write to a file.

Thanks very much in advance.

Djurre
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

create a script that resides on the respective servers and writes the file. (secure it) .. then you can call it from whichever server and write to the file using a form post or some other http transfer method.
d52477001
Forum Newbie
Posts: 6
Joined: Sun Jan 11, 2004 8:21 am
Location: Gaborone, Botswana

Post by d52477001 »

yeah i thought about that but i wasn't sure exactly how to implement it and how to call the script. Would you mind explaining a bit more?

thanks

Djurre.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you can use [php_man]curl[/php_man] or the file url wrapper functions ([php_man]file_get_contents[/php_man], [php_man]fopen[/php_man]) to make a query to the other page.. you could add some checksums or something to help secure the input, so the script knows it's from you.
Post Reply