tru2dalimit
Programmer
Hi im new to PHP, and i wrote a piece of code that contains a drop down menu with three items and i wanted to retain the item selected when i come back. I used a session variable to retain the variable and created a fuction:
if(isset($HTTP_POST_VARS['Salutation']))
{
$Salutation = $HTTP_SESSION_VARS['Salutation'];
}
function match($str)
{
if($str == $Salutation)
{
return = 'SELECTED';
}
return '';
}
Now when i call the function within my form it doesn't read it:
<form action="samp.php" method="POST" name="application" id="application">
<SELECT NAME="Salutation">
<Option Value="Mr." match('Mr.') > Mr.</Option>
<Option Value="Ms." match('Ms.') > Ms.</Option>
<Option Value="Mrs." match('Mrs.') > Mrs.</Option>
</SELECT>
Any help is greatly appreciated
Thanks
if(isset($HTTP_POST_VARS['Salutation']))
{
$Salutation = $HTTP_SESSION_VARS['Salutation'];
}
function match($str)
{
if($str == $Salutation)
{
return = 'SELECTED';
}
return '';
}
Now when i call the function within my form it doesn't read it:
<form action="samp.php" method="POST" name="application" id="application">
<SELECT NAME="Salutation">
<Option Value="Mr." match('Mr.') > Mr.</Option>
<Option Value="Ms." match('Ms.') > Ms.</Option>
<Option Value="Mrs." match('Mrs.') > Mrs.</Option>
</SELECT>
Any help is greatly appreciated
Thanks