users.txt
file?
file_put_contents()
will create a file if it's not already there.
file_put_contents
, the permission is denied even though I have set the permission in the webster to be ok to write, so how could i get the permission to write in the file.
die
. Use the header
function to redirect.
header
function must come before you produce any output from your file. If you output any HTML and then try to set a header, PHP will complain. So do any code/logic involving headers first. Keep in mind that even just having whitespace from being in non-HTML mode, or an HTML comment at the top of your file, or including a file full of HTML, will count as "output".
setcookie
function must come before you produce any output from your file. If you output any HTML and then try to set a cookie, PHP will complain. So do any code/logic involving headers first. Keep in mind that even just having whitespace from being in non-HTML mode, or an HTML comment at the top of your file, or including a file full of HTML, will count as "output".
session_start
at the start of every page that uses sessions.
The session_start
function doesn't create a new empty session every time you call it.
It just initializes PHP's session management system and creates/fills in the $_SESSION
array for you.
session_start
to initialize PHP's session system before you can call session_destroy
.