Jump to content

[SOLVED] what to do after login in


ls354

Recommended Posts

Hello everybody I been learning some PHP from a book and after a while of using google and not finding an answer I dediced to come here. Here's the problem I am trying to create a basic login page in PHP whitout using a database to reduce complexity at the moment ,but after I get the login successful, I have no idea on how to redirect the page to lets say a folder or page.

 

This is my php

 

<?php

session_start() ;

 

$passwords = array ("test" => "test");

 

if (!$_POST["username"] or !$_POST["password"]) {

echo "You must enter your username and password";

exit;

}

 

if ($_POST["password"] == $passwords[$_POST["username"]]) {

echo "Login successful";

$_SESSION["auth_username"] = $_POST["username"];

}

else {

echo "Login incorrect";

}

?>

 

Thank you in advance.

Link to comment
https://forums.phpfreaks.com/topic/42301-solved-what-to-do-after-login-in/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.