Reputation: 3263
I call my php file in the browser with "...test.php?text=Hello" but the $_POST
variable stays empty (also print_r($_POST)
returns array()
).
Why? Do I need to activate the post variable or something?
Thanks.
Upvotes: 0
Views: 964
Reputation: 2924
...test.php?text=hello
passes data via the GET method (accessible via $_GET
in the processing script).
$_POST
gets populated by forms or cURL access (when the transfer method is defined as "post")
Upvotes: 0
Reputation: 1743
If you pass the variable through the URL you use $_GET. Also, you will access the variable with:
$_GET['text']
This is a array that is sent through and you need to specify what item in the array you want to use.
Upvotes: 0