mardi 27 mai 2014

Show progress image of a user profile


Vote count:

0




I'm trying to show the progress of a user filling out their user profile by an image sequence.


Example, if the user fills out their name, progress image 2 will show up. If the user fills out their name and bio, progress image 3 will appear, and so on....


I'm trying to use if and elseif statements, but only progress image 2 will appear.


So basically, I just want one image to show based on the progress the users has made on completing the user profile form.


Here is my code.



<?php
$name = ($data->first_name);
$bio = ($data->bio);
$address = ($data->street1);
$phone = ($data->phone);
$ec = ($data->e_contact);
$ecp = ($data->e_phone);
$bs = ($data->bs);

if($name == true){?>
<img src="../images/progress2.png" class="img-max-progress">
<?php }


elseif($name.$bio == true){?>
<img src="../images/progress3.png" class="img-max-progress">
<?php
}

elseif($name.$bio.$address == true){?>
<img src="../images/progress4.png" class="img-max-progress">
<?php
}

elseif($name.$bio.$address.$phone == true){?>
<img src="../images/progress5.png" class="img-max-progress">
<?php
}

elseif($name.$bio.$address.$phone.$ec == true){?>
<img src="../images/progress6.png" class="img-max-progress">
<?php
}

elseif($name.$bio.$address.$phone.$ec.$ecp == true){?>
<img src="../images/progress7.png" class="img-max-progress">
<?php
}

elseif($name.$bio.$address.$phone.$ec.$ecp.$bs == true){?>
<img src="../images/progress8.png" class="img-max-progress">
<?php
}
?>

<?php
if($name != true){?>
<img src="../images/progress1.png" class="img-max-progress">
<?php
}
?>


I have the form filled out so progress8.png should be the image that is shown, but progress2.png is currently showing.



asked 58 secs ago






Aucun commentaire:

Enregistrer un commentaire