Is it bad practice to write to $_POST?

后端 未结 7 1553
心在旅途
心在旅途 2021-01-11 17:55

If this is file_1.php


7条回答
  •  广开言路
    2021-01-11 18:29

    The $_POST should only be used with forms not like this:

    $_POST["test_message"] = "Hello, world";
    

    You also need to make sure that you avoid any security risks, use functions like stripslashes and mysql_real_escape_string (when inserting data in database)

    To maintain state between pages, you need to use the sessions instead.

提交回复
热议问题