That would probably do it yeah.
PHP Code:
if (isset($_POST['avalue']))
{
$avalue = $_POST['avalue'];
}
for example would create $avalue out of $_POST['avalue'] so long as it exists. The downside is, if you don't contain this than $avalue is not available at all and any attempts to read it would trigger an undefined variable error.
Easiest way to save keystrokes it to use a ternary and give it a default:
PHP Code:
$avalue = isset($_POST['avalue']) ? $_POST['avalue'] : 'a default value.';
Which guarantees $avalue will be set and will have a value regardless of if $_POST['avalue'] is set. Beyond this, you now operate on $avalue to perform validation and verification which may or may not fail your business rules, but will no longer throw an undefined offset nor undefined variable error.