variable not displaying in output?
I perform the following..
$output = $_GET['_url'];
echo $output;
//d开发者_如何学Pythonisplays the url in $output, correctly
if ( isset($_POST['email'])){
//'email' is not empty
echo "url: " . $output;
//it displays "url: " but does not display the url from $output
}
I enter an email and on submit it does not echo the $output var during the if post.. only outside of it.
Why is this the case and what can I do to fix it?
You're mixing $_GET and $_POST.
Try adding:
var_dump($_GET);
var_dump($_POST);
and see what you get. That should help you figure out what's happening
You are probably mixing GET and POST requests. Is the request GET or POST? It can't be both!
Edit: it can, but still, check if your form is sent as GET or POST and update the variables accordingly. Unless you do POST request to url like someurl?var=something.
精彩评论