PHP and file write permissions

前端 未结 3 1561
一整个雨季
一整个雨季 2020-12-18 08:43

I have a folder with 3 different php scripts in it. email.php txt.php android.php

I pipe emails and/or txts to their respective scripts, and use http POST to send da

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-18 09:26

    if it is a permission problem and you are

    unable to manually change the permissions to 777

    maybe you could try:

    $filename= "output.php";
    
    // programatically set permissions
    if(!file_exists($filename)){
        touch($filename);
        chmod($filename, 0777);
    }
    
    $data = '//data fields condensed into a single string obtained from email or txt';
    $newFile= fopen($filename, 'w+');
    fwrite($newFile, $data);
    fclose($newFile);
    

提交回复
热议问题