Copy link to clipboard
Copied
I have a login page, some standard pages and a page with a form that connects through to a database on it.
I have the login functionality working (using the standard dreamweaver user authentication functionality). I want to be able to use the username of the person who has logged in, in one of the form fields (username field) so that they don't have to type it again.
The code in the form is:
GetSQLValueString($_POST['user_id'], "int"),
GetSQLValueString($_POST['game_id'], "int"),
GetSQLValueString($_POST['game1_home'], "int"),
GetSQLValueString($_POST['game1_away'], "int"),
GetSQLValueString($_POST['game2_home'], "int"),
The line in bold is where I need it to reference the username.
I can post the user authentication code if required (I use the standard dreamwqeaver functionality, and the form page above has the user authentication check code on it) - as I say I'm stumbling my way through this so would really appreciate any help!
Many thanks,
Darren
Copy link to clipboard
Copied
A session variable lives until the session is closed, so when they close their browser, they would need to log in again.
To create the session variable you could do this
$_SESSION['user_id'] = $_POST['user_id'];
Then to make is even easier, you can put it into a variable
$sid=$_SESSION['user_id'];
gary
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more