Arbitur
Arbitur

Reputation: 39081

How can I open another url from a php file and pass some values with the get method?

I have a php script that checks if the user typed the right password for the right username.

If its right I want to open another php page and pass some values with the get method. How do I do this? Im pretty new to php.

Upvotes: 1

Views: 654

Answers (2)

Jason OOO
Jason OOO

Reputation: 3552

You can redirect to that page if this is your case:

if(condition){
 header("Location: yourfile.php?parameter1=value1&parameter2=value2");
 exit();
}

Note: header should be called before any output, its recommended to call it at top of the page before printing anything.

Or use cURL to send the GET request.

Upvotes: 1

Elon Than
Elon Than

Reputation: 9765

Don't use GET to send password!

Instead try to use cURL lib and send it via POST.

Upvotes: 0

Related Questions