|
-
May 14th, 2007, 01:11 AM
#1
Thread Starter
Lively Member
Pass variable from one page to another
How can I get the value of a variable from the previous page to the current page?
I'm currently creating a login system in PHP. I have 3 files; login.php, checklogin.php, and main.php.
Flow: login.php --- checklogin.php --- main.php
I have a variable inside checklogin.php named as $id.
I assigned value to it:
$id=$_POST['id_number']; //id_number is the name of the textfield in login.php
Now, I want to assign the value of $id from checklogin.php to variable $id_num from main.php and print the value.
To become a PROFESSIONAL,
Start from SCRATCH... 
-
May 14th, 2007, 02:13 PM
#2
Re: Pass variable from one page to another
use sessions or cookies to store the value in checklogin.php once you have cleared the user as being able to login.
then, in main.php you can just check if the session or cookie exists and is valid. if not, redirect to login page or something of that sort.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|