Making a file at public_html Dir

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
User avatar
lazerbri
Forum Newbie
Posts: 15
Joined: Sat Dec 27, 2003 8:17 am

Making a file at public_html Dir

Post by lazerbri »

Sami | Help us, help you. Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Hi Guys

I no you need to cmd a folder to 0777 to copy to it but I want to make a file on my public_html dir but dont want to change the cmd of this folder.

Is this possible.

Code: Select all

$url01 = $DOCUMENT_ROOT ."/test02.php";
$fd = fopen($url01, "w+") or die("Did not open file: " . $url01); 
$fw = fwrite($fd, "$text" )or die("Could not write to file: " . $url01);  
fclose($fd);
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Change the permission, when done uploading or whatnot, change the permission back
User avatar
lazerbri
Forum Newbie
Posts: 15
Joined: Sat Dec 27, 2003 8:17 am

Post by lazerbri »

sorry I should of added its for a third party program
Post Reply