0

Hey ive followed a guide on here and i managed to setup a register place but when i login it says

?php session_start(); if (!$_SESSION["valid_user"]) { // User not logged in, redirect to login page Header("Location: login.php"); } // Member only content // ... // ... // ... // Display Member information echo "

User ID: " . $_SESSION["valid_id"]; echo "

Username: " . $_SESSION["valid_user"]; echo "

Logged in: " . date("m/d/Y", $_SESSION["valid_time"]); // Display logout link echo "

Click here to logout!
"; ?>

Any ideas it's just a white page it's creating the accounts correctly (i think) because when you enter wrong details it says

Sorry, could not log you in. Wrong login information.
2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by vaultdweller123
0

your code is a mess... arrange it neatly.

<?php 

session_start(); 
if (!$_SESSION["valid_user"]) { // User not logged in, redirect to login page
Header("Location: login.php"); 
}
// Member only content // ... // ... // ... // Display Member information 

echo "User ID: " . $_SESSION["valid_id"]; 
echo "Username: " . $_SESSION["valid_user"]; 
echo "Logged in: " . date("m/d/Y", $_SESSION["valid_time"]); // Display logout link 
echo "Click here to logout!"; 

?>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.