Manakin
Manakin

Reputation: 3

Send post through two files

I'm making a login system in PHP. I have three files, login.php, check.php and login_success.php.

In the login.php I have the login form where you enter a username and password then hit a button which will send the data to check.php with $_POST to see if the login matches with the database. If it does, it will continue on to login_success.php where the user is actually logged in and will see the content of the webpage.

Now to my problem/question: I want to be able to use the variables that I posted to check.php from login.php in the login_success.php.

Is there a way I can keep posting the data through one file to a third?

I have tried using include = 'check.php'; but that didn't work as nothing had been sent to that file so the variables were empty.

Hopefully someone knows a way, thanks!

Upvotes: 0

Views: 64

Answers (1)

Ananth
Ananth

Reputation: 1560

if you want that Post data from login page to the login_success.php page then you must store that post data to the $_SESSION variable then only you will get it on the login success page.

Upvotes: 3

Related Questions