Retrieve Post Value Based On Condition

Hi,

Please see the sceanrio.

==========

if(condition)

{

$var = "option1";

}

else

{ $var ="option2";

echo $_POST[$var];

===================

The above code throws error.

what needed was $_POST[‘option1’];

Any idea how to place a variable inside post?

You can’t do that.

there is no way to assign var into POST, and there is no need to do that

if(condition)

{

$var = "option1";

}

else

{ $var ="option2";

echo $var;

}

please specify your requirement to "place a variable inside post"