How to get variable from an HTML form?

Asked

Viewed 50 times

2

I have an HTML file (html1) to fill user and pass, and call a PHP file (php1) to authenticate the values. But I need the user in another PHP file (php2) how to call the value of user in the php2 file?

1 answer

3


A simple way of doing and creating a session and putting the user in it.

example :


session_start();

$_SESSION_['user'] = $user;

// no outro arquivo você chama $_SESSION_['user']

another way too and include the second file.


include('caminhodoarquivo.php');

// chame $user;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.