PHP header(Location: …): Force URL change in address bar

I’m currently working on a mobile site with authentication using PHP sessions with a database. I have a login page with a form that goes to server_login.php on submit. The php file then creates some session data (store in $_SESSION), and redirects the user back to the index page: The new web page (index.php) loads correctly; however, … Read more

PHP page redirect

Yes, you would use the header function. It is a good practice to call exit() right after it so that code below it does not get executed. Also, from the documentation: Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a … Read more

In the shell, what does ” 2>&1 ” mean?

File descriptor 1 is the standard output (stdout).File descriptor 2 is the standard error (stderr). Here is one way to remember this construct (although it is not entirely accurate): at first, 2>1 may look like a good way to redirect stderr to stdout. However, it will actually be interpreted as “redirect stderr to a file named 1“. & indicates that what follows and precedes is … Read more