/ Published in: PHP
Check to see if HTTP POST variable exists before doing something with it.
Expand |
Embed | Plain Text
$name = $_POST['name']; }
Comments
Subscribe to comments
You need to login to post a comment.
jonkemp on 07/01/10
1 person have marked this snippet as a favorite
Check to see if HTTP POST variable exists before doing something with it.
$name = $_POST['name']; }
Subscribe to comments
You need to login to post a comment.
very simple, but a very common piece of code. Handy for copy pasting.
Can also be written as:
if ( isset($POST['name']) ) { $name = $POST['name']; }
for all those who always like to be positive ;)