Hi there,
I have register form, you can register etc. and later on you can change your profile.
At the 'change profile' section, you can select the type of font you want to show the webpages in. I have a mysql database with the font names and font paths. But when you come on the 'change profile' page. The first entry in the listbox is selected. I want the font that someone is using now to be seleted. The problem is this:
So if you have multiple options, you have to do this:
If I have like 100 fonts, I have to type so much, and it's much easier to just add it to the mysql-database.
Is there an easier way to do this.
Thanks in advance.
I have register form, you can register etc. and later on you can change your profile.
At the 'change profile' section, you can select the type of font you want to show the webpages in. I have a mysql database with the font names and font paths. But when you come on the 'change profile' page. The first entry in the listbox is selected. I want the font that someone is using now to be seleted. The problem is this:
| My script wrote: |
|
<select name="font" id="font"> <option value="trebuc" selected>Trebuchet MS</option> </select> |
So if you have multiple options, you have to do this:
| Code: |
|
<select name="font" id="font"> <?php if($selected_font == "trebuc") { ?> <option value="trebuc" [b]selected[/b]>Trebuchet MS</option> <option value="trebucbd">Trebuchet MS Bold</option> <?php }elseif($selected_font == "trebucbd") { ?> <option value="trebuc">Trebuchet MS</option> <option value="trebucbd" selected>Trebuchet MS Bold</option> <?php } ?> </select> |
If I have like 100 fonts, I have to type so much, and it's much easier to just add it to the mysql-database.
Is there an easier way to do this.
Thanks in advance.
