FTP and Creating New Files
Posted: Tue Jan 04, 2005 5:26 pm
Hey there,
I have written a PHP script that can create, edit and delete PHP files on the web server.
My script is used on my clients websites which use CPanel, so all of the files and folders are saved in the /public_html/ folder.
I currently use this code to create a file in the /public_html/ folder:
Which works fine ONLY if the /public_html/ folder is CHMODed to 777.
However, their host have an automatic script that changes the CHMOD of the /public_html/ folder to 750 resulting in my script not being able to create files.
Is there a way to create new files without having the /public_html/ folder set to 777?
Cheers
Ben
I have written a PHP script that can create, edit and delete PHP files on the web server.
My script is used on my clients websites which use CPanel, so all of the files and folders are saved in the /public_html/ folder.
I currently use this code to create a file in the /public_html/ folder:
Code: Select all
<?php
$fp=fopen("filename.php",w);
fputs($fp,$content);
fclose($fp);
?>However, their host have an automatic script that changes the CHMOD of the /public_html/ folder to 750 resulting in my script not being able to create files.
Is there a way to create new files without having the /public_html/ folder set to 777?
Cheers
Ben