SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: FTP and PHP

  1. #1
    SitePoint Evangelist Mr. Tech's Avatar
    Join Date
    Feb 2003
    Location
    Australia
    Posts
    562
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking FTP and PHP

    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:

    PHP Code:
    $fp=fopen("filename.php",w);
     
    fputs($fp,$content);
     
    fclose($fp); 
    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

  2. #2
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use FTP?

  3. #3
    Resident Java Hater
    Join Date
    Jul 2004
    Location
    Gerodieville Central, UK
    Posts
    446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by petesmc
    Use FTP?
    Better still not use CPanel, it's a piece of cack that's riddled in bugs and security holes

  4. #4
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Isn't there an alternative to CPanel though... Just can't remember where I read about it

  5. #5
    SitePoint Addict trogdor1024's Avatar
    Join Date
    Oct 2004
    Location
    New Jersey
    Posts
    235
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  6. #6
    SitePoint Evangelist Mr. Tech's Avatar
    Join Date
    Feb 2003
    Location
    Australia
    Posts
    562
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    All I need is a peice of code... I can't change from CPanel...

    Anybody know how this is done?

    Cheers


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •