i’m just wondering how are you suppose to put a function within an echo statement?
function Catselect($abc){
global $category;
if($category == $abc){
echo 'selected ="selected"';
}
}
echo'
<select style="width: 260px;" name="category">
<option value="01" '.Catselect("01").'>Site Related</option>
<option value="02" '.Catselect("02").'>Tournaments</option>
<option value="03" '.Catselect("03").'>Articles</option>
<option value="04" '.Catselect("04").'>Interviews</option>
<option value="05" '.Catselect("05").'>General</option>
</select>
';
I’m trying to make a update page where you’ll get to see what the previous category was, so let’s say before that, the category is Tournaments with value 2, if you were to go to the update page, the tournament category would be automatically selected.
But what i get is just the word selected =”selected” on top of my header.
Any help ?
Instead of
echo 'selected ="selected"';tryreturn 'selected ="selected"';