Child

Storing signup details in mysql table using PHP


This is the second part of the login-signup script specially developed if register_global is set to off. Please check the basic PHP Signup & login script to get full details. 

If register_global is OFF then following changes are down to the script. 

All variables after submitting the form will not be available directly. For example if userid is entered in login.php page then this value will be available at loginck.php page like this 

$usrid=$_POST['userid'];


Same way for all pages and for all variables it is to be done. Take care of login, update profile and change password pages. 

Session Management if regirster_global is off
This is bit complicated. Take care that for initializing all form values you get through $_POST or $_GET method as explained above. 

Do not use
session_register("session");


to start a session. 
Initiate session id and user id like this 

$_SESSION['id']=session_id();
$_SESSION['userid']=$userid;


Now you can't access userid stored in session like $session[userid] , in this place use $_SESSION['userid']. So all queries, welcome message, updating log etc are to be changed with this new way of collecting userid from session. PHP version 5 and above uses this type of session management so if you are using PHP 5 or above then use this script. You can check your PHP Version running at your server. 

Getting IP address if register_global is Off 

We can't get IP address of user like this 

$ip=@$REMOTE_ADDR;
We have to use
$ip=$_SERVER['REMOTE_ADDR'];


With all these modifications you can download the login-signup script.