Warning: fopen(page/): failed to open stream: Is a directory in /home/loshas/public_html/writeFile.php on line 6

Warning: fwrite(): supplied argument is not a valid stream resource in /home/loshas/public_html/writeFile.php on line 7

Warning: fclose(): supplied argument is not a valid stream resource in /home/loshas/public_html/writeFile.php on line 8

Warning: fopen(page/): failed to open stream: Is a directory in /home/loshas/public_html/writeFile.php on line 6

Warning: fwrite(): supplied argument is not a valid stream resource in /home/loshas/public_html/writeFile.php on line 7

Warning: fclose(): supplied argument is not a valid stream resource in /home/loshas/public_html/writeFile.php on line 8

SpooF

٩๏̯͡๏۶

Posts: 3422

Loc: Richland, WA

3+ Months Ago

thats because that file got deteted and does exists, and it doesnt have to load it, so it lets do submit.
http://theloshas.com/editFile.php?file=body.inccompared to
http://theloshas.com/editFile.php?file=blah.inc

if you use the link
http://theloshas.com/writeFile.php?file ... mit=Submit

Rabid Dog

Web Master

Posts: 3243

Loc: South Africa

3+ Months Ago

Why are you outputting the text area to the url? take that variable away, it is just going to cause problems

SpooF

٩๏̯͡๏۶

Posts: 3422

Loc: Richland, WA

3+ Months Ago

Not to be mean or anything but can you help with getting my editFile,php page to work, so the file will load in the page so i can see whats in it? then i can go from there and get othe things to work or ask for more help.

Rabid Dog

Web Master

Posts: 3243

Loc: South Africa

3+ Months Ago

Dude I don't know what the issue is. You tell me it works on one machine and not the other.

Is your box a linux or windows box?
is the server a windows or linux box?
What version is the PHP that it works on?
What version is the PHP that it doesn't work on?

If you want people to help you need to supply the correct info, otherwise you end up with what happened now. People going backwards and forwards trying to guess the problem.

The only conclusion I can come to is that there is a config problem on one of the machines. If it works on one and not the other is not the script.

chmod("page/$file",0777);//according to PHP manual the mode most be octal

}

$handle=fopen("page/$file","w");

fwrite($handle,$buffer);

fclose($handle);

if($backup== 1){

$handle=fopen("page/backup/$file","w");

fwrite($handle,$buffer);

fclose($handle);

}

$file=$_GET['file'];

$buffer=$_POST['buffer'];

$backup=$_POST['backup'];

if(!is_writeable("page/$file")){

chmod("page/$file",0777);//according to PHP manual the mode most be octal

}

$handle=fopen("page/$file","w");

fwrite($handle,$buffer);

fclose($handle);

if($backup== 1){

$handle=fopen("page/backup/$file","w");

fwrite($handle,$buffer);

fclose($handle);

}

Let me know if that works

SpooF

٩๏̯͡๏۶

Posts: 3422

Loc: Richland, WA

3+ Months Ago

nah that doesnt work i get the error

Quote:

Warning: chmod(): Operation not permitted in /home/loshas/public_html/writeFile.php on line 9

but then i just found out that you can edit 644 permission, dont get why it errored me before. So it looks like everything here is DONE! finaly, i though it would never end. Thank you once again. eveything is worken just fine.

Rabid Dog

Web Master

Posts: 3243

Loc: South Africa

3+ Months Ago

So the chmod works in PHP?

SpooF

٩๏̯͡๏۶

Posts: 3422

Loc: Richland, WA

3+ Months Ago

no it didnt work, and now i need it, this is weird sometimes it lets you edit 644 files then it doesn't