i'm trying to write a routine that will allow a user to create a file in his home dir. to simplify, let's assume i have the user's system alias & password, and home directory, and want to create a file 'test.txt' with contents 'hi there'.

i was successful in testing how much space was being used in the user's directory by using the imap functions, but haven't been able to use them to do this.. I created a mailbox, and appended the text to it, but it adds all that junk to the top of the box.

any ideas?
I'm guessing there might even be a linux command to do this..i dunno

much thanks in advance!
Blake

    Give the user that the httpd is running under write access to that file.
    e.g
    touch filename.txt
    chown root:userid filename.txt
    chmod 770 filename.txt

    CT

      i'm trying to edit the user's Sendmail .forward file. this file has to have permissions of the user's alias, and user's group, and has to be chmodded to 755 or more secure.

      can't do that
      any other suggestions?
      i know i could set up a root cron or somethin, but i'd rather have access at it live.

      thanks

        If you feel up to managing the risks, you could always exec() a script that used su to become the required user. NOT that I'm recommending this route, oh no! but just pointing out that it does exist. :-)

          When you don't have access at file in a livetime environment (eg. on a provider server, or something) you can use FTP.

          With FTP you can connect with a privileged account (for you the owner of the "Sendmail .forward" file) and then put a new file there.

          When you use FTP from within PHP script, the local-site is in the directory where the webserver runs your PHP script.

          Gerald

            that's brilliant!
            i can't believe i didn't even think of FTP.
            thanks. That helps me in so many ways - cause now i don't have to worry about what server it's on.

            I'll try that out,

            blake

              Write a Reply...