Jump to content

Php registration script tutorial


crazyman

Recommended Posts

When making a registration you want field that havve $_POST['get']; Variables assigned to them! these then go into the database and when you make a login it simply goes

SELECT FROM TABLE `users` WHERE USERNAME=$_POST['username'] AND PASSWORD=$_POST['password']; Then it takes that data. Sees if the SQL is correct and if so looks for the datafield containing that Query and if it finds it then it registers a Session Super Gglobal. allowing you to do stuff. Then say your superglobal is called $valid_user (Which is the global I always use) then it registers it and later sees if it is registered like:

 

<?php
$valid_user = $_SESSION['valid_user'];
if (session_is_registered('valid_user')){
echo 'You Are logged in As' . $valid_user . '';
}
?>

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.