garrensilverwing
New Member
- Messages
- 148
- Reaction score
- 0
- Points
- 0
hey again guys,
i am having a new problem. i am still working on creating a member profile feature for my website but i am having a problem with an if argument. when the person goes to the edit profile page i want all the information that is already in the profile to show up and be edited. i have the gender options set in a dropdown box and i want the current gender to be already selected on the edit profile page. so i figured an easy way would be a simple if statement saying if $'gender = M then the selected="selected" would be echoed for that options in the drop down box. the problem is there are three options (M,F,do not share) and all three of them are passing the if argument. if i change it to $gender==M then none of them pass. also i doubled checked to make sure that $gender was being properly set. i also tried it with multiple quotation/equal sign set ups. here is the code:
i am having a new problem. i am still working on creating a member profile feature for my website but i am having a problem with an if argument. when the person goes to the edit profile page i want all the information that is already in the profile to show up and be edited. i have the gender options set in a dropdown box and i want the current gender to be already selected on the edit profile page. so i figured an easy way would be a simple if statement saying if $'gender = M then the selected="selected" would be echoed for that options in the drop down box. the problem is there are three options (M,F,do not share) and all three of them are passing the if argument. if i change it to $gender==M then none of them pass. also i doubled checked to make sure that $gender was being properly set. i also tried it with multiple quotation/equal sign set ups. here is the code:
Code:
<?php $Gender = $ProfileContent[20]; ?>
<label>Gender: </label><select name="Gender">
<option <?php if($Gender = ""){ echo "selected=\"selected\""; } ?> value="">Do Not Share</option>
<option <?php if($Gender = M){ echo "selected=\"selected\""; } ?> value="M">M</option>
<option <?php if($Gender = F){ echo "selected=\"selected\""; } ?> value="F">F</option>
</select>