Form Interrogation Efficiency Question
Posted: Sun Aug 18, 2002 4:15 pm
Hi guys, I use $_POST['variable'] to collect data from a form. Now let's say I have a SELECT in my form with lots of options and I want to do an if...elseif...else on the value, for example:
$strValue="Insufficient Entry";
if($_POST['variable'] == 0){
$strValue="None Entered";
elseif($_POST['variable'] == 1){
$strValue="Selection Number 1";
}
...
...
// lots of them
Is it better to go:
$formValue=$_POST['variable'] first and then do the conditional test on $formValue ?
I'm wondering if everytime I go $_POST['variable'] it does more than just pulling a value from an existing array.
Thanks guys.
$strValue="Insufficient Entry";
if($_POST['variable'] == 0){
$strValue="None Entered";
elseif($_POST['variable'] == 1){
$strValue="Selection Number 1";
}
...
...
// lots of them
Is it better to go:
$formValue=$_POST['variable'] first and then do the conditional test on $formValue ?
I'm wondering if everytime I go $_POST['variable'] it does more than just pulling a value from an existing array.
Thanks guys.