Thread: coding question
View Single Post
Old 01-17-2014, 04:14 PM  
Ketchup
Confirmed User
 
Ketchup's Avatar
 
Join Date: Jul 2006
Location: Toronto Canada
Posts: 563
Quote:
Originally Posted by sarettah View Post
Easy enough to make it display height as feet in the select box. However, unless you are going to change the program that is handling the form to handle it as feet , you want to keep what is passed into the program as inches still.
thanks for your help yes that is what I am trying to do is make it display in feet in the profile page

the code for the people to add their profile to the site is

<label>Height:</label>
<select name="height" class="search_input">
<option value="">--select--</option>
<? for($i=58;$i<=73;$i++) {
?>
<option value="<?=$i;?>" <? if($rs['height']==$i) { echo "selected"; }?>>
<?=$i;?>
</option>
<? } ?>
</select>


and the code on the actual profile page visible to public is


<p>Height:
<?=$detail['height'];?>


how do i make that ^ display as feet? Thanks!


edit it used your code as this on the create profile page and it changed it to feet now to get the profile to display in feet thanks!

<label>Height:</label>
<select name="height" class="search_input">
<option value="">--select--</option>
<? for($i=58;$i<=73;$i++) {
?>
<option value="<?=$i;?>" <? if($rs['height']==$i) { echo "selected"; }?>>


<?=intval($i/12) . ' feet ' . ($i-(intval($i/12)*12)) . ' inches';?>

</option>

Last edited by Ketchup; 01-17-2014 at 04:23 PM..
Ketchup is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook