PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have the following code..the username and password works fine but i want the script to go to another webpage if the username and password is enetered correctly.
The simplest way is to just put the "other" page HTML where you now have "<p>This is the protected page. Your private content goes here.</p>". You could also do "include('protectedpage.php');".
// This doesn't work.
echo "Some text goes here.";
header("Location: http://www.example.org/");
// This works.
ob_start();
echo "Some text goes here.";
header("Location: http://www.example.org/");
ob_end_flush(); // You don't have to call this at the end, but you should.