how to write variables value with file_put_contents()?

前端 未结 5 919
北海茫月
北海茫月 2021-01-21 10:28

Have been trying to figure this out all day assuming its just a small error.....

I\'m trying to use the file_put_content to put a variables value into anoth

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-21 11:29

    There are a few things wrong with this code. First, to address your problem, single quotes do not expand variables. That is the difference between single quotes and double.

    After cursory inspection, I would recommend the following additional changes:

    1) Sanitize your input prior to inserting into the database, you can use mysql_real_escape_string for this.

    2) Use copy inside of a function that recurses the directory in order to copy it. This allows proper error handling. At a minimum, sanitize $GDI_user (via basename or some other method to prevent ..)

提交回复
热议问题