从URL PHP [重复]中获取关键字

This question already has an answer here:

I'm gonna explain everything.

So I managed to code a script that fills the POST form for you, and now when the form fills and the user logs in, they get a special key, I want to obtain this special key from the URL, let's say the URL is.

script.php?key=1145682c3e7060514f57530c284f9ae3

This key will be changed every time the user logs in.

I hope I explained correctly.

Thanks!

PS. Script.php isn't hosted at my server, the script that auto fills the form is hosted at my server. I basically want it to auto fill the form (already finished that) then takes the key.

There's a login form ON A WEBSERVER THATS NOT MINE, after you login you get a key in the URL bar. I coded a script hosted ON MY WEBSERVER to go to that form and auto fill it using cURL, I need to make MY SCRIPT to obtain the key from the URL bar.

</div>

You have to use the superglobal $_GET variable like:

$_GET['key']

You can get the value from the querystring using this:

$key = isset($_GET['key']) ? $_GET['key'] : null;

If it was posted:

$key = isset($_POST['key']) ? $_POST['key'] : null;

Check it by doing:

if ($key) {
    // do something here something          
}