making $var = $text$var
Posted: Mon Apr 11, 2005 12:44 pm
I have a function that takes an 'option' box and makes whatever value is passed in the function the variable for that = 'selected'. For example:
...so on...
I'm basically just trying to make $dayX = 'selected' but i can't make a variable $day$text = "selected"; is there a way i can get this to work (or a better way i should be doing this?
Thanks,
Jr-
Jcart | If you are going to post code of any kind, please review Posting Code in the Forumsfirst
Code: Select all
function bday_day($text)
{
IF ($text == "")
{ $na = "selected"; }
ELSE
{
$day$text = "selected";
}
print "<select name='bday_day'>";
print "<option value='' $na></option>";
print "<option value='1' $day1>1</option>";
print "<option value='2' $day2>2</option>";
print "<option value='3' $day3>3</option>";
print "<option value='4' $day4>4</option>";
print "<option value='5' $day5>5</option>";
print "<option value='6' $day6>6</option>";
print "<option value='7' $day7>7</option>";
print "<option value='8' $day8>8</option>";I'm basically just trying to make $dayX = 'selected' but i can't make a variable $day$text = "selected"; is there a way i can get this to work (or a better way i should be doing this?
Thanks,
Jr-
Jcart | If you are going to post code of any kind, please review Posting Code in the Forumsfirst