0

I know how to bind a variable in to a request like this;

header("location:../dashboard.php?name=name");

but I want the variables to be hidden in the url, like this;

header("location:../dashboard.php");

and send the variable using POST method

how can I do this without using sessions or cookies?

thank you.

1 Answers1

0

It is not possible. The only thing you can do is to create a HTML form and invoke it using JavaScript. But this is merely a hack than a solution.

Please describe what you want to achieve, not how.

The Wavelength
  • 2,836
  • 2
  • 25
  • 44
  • I want to send a user's login data from the login page to the user's home page. but when the home page is loaded, I want to match that login data with the data saved in the session. thank you – Udana Randitha Sep 10 '14 at 15:29
  • Then why do you ask "without using sessions"? For authentication, you don't have to store login data in the session or pass it to another page with get or post. At the login page, you compare the supplied login-data to the database. On successful login you set a variable "authenticated" in the session. In following pages you just check whether this variable exists, and if not, you redirect back to the login page. – leofonic Sep 10 '14 at 17:22