Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to use fopen and gettinfailed to open stream: Permission denied 1

Status
Not open for further replies.

Chomauk

Programmer
Jun 8, 2001
130
Hi, at one time this worked and now it doesn't. Can anyone tell me what I need to do to create a file in my directory. I'm using a webhost and here is the code:
Code:
<?php 
$ID = substr(uniqid("ID"),6);  
$data = "This is a new file entry!\n";   
$file = "Confirm_". $ID. ".php";
echo $file;

$file_handle = fopen($file,"w+");
fwrite($file_handle, $data);
   
fclose($file_handle);   
?>
That's if for now but I'm getting an error of
fopen(Confirm_3848f0f4a.php): failed to open stream: Permission denied for all three...fopen, fwrite and fclose.
I've read some stuff on chmod but don't understand(yes I'm a newbie). Can anyone tell me what I need to do to create a file?

thanks


"Failure is the tuition you pay for success."
~ Walter Brunell ~
 
OK thanks I'll do it that way.

"Failure is the tuition you pay for success."
~ Walter Brunell ~
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top