如何使用url发送php变量

I want to for example send the $test in a url then I want to use $_GET ti get the variable.

This is probably a stupid question but if you have another way of doing this then please let me know. By the way I would usually use include for this but I can't use it this time because of some really long reason. The other option I considered was fwrite. The problem with this is that multiple users will be trying to write this files at once. Its just not practical.

Any help or hints will be great. Thanks guys. Sorry for the stupid question

you should type this in your webbrose

www.host/yourscript.php?test=1
<?php
    $test = 1
    $passvar = "mynextpage.php?test=$test";
?>

and from the next page you could do

<?php
    $passed_var = $_GET['test'];
?>

Ah, I understand your question now.

You want to use the variable already defined $test and pass it in your script somewhere.

If you pass the "variable" through the URI like such: page.php?a=test

You can then say...

echo "The value of of \$test is " . $$_GET['a'];

Example how it works:

$test = 'apples'; // your variable
$_GET['a'] = 'test'; // the get variable

echo $$_GET['a']; // the string value of the get value appended to an empty variable