How to print rating stars in php | print star in php



How to print rating stars in php


<?php

if(isset($_POST['submit']))
{
$star = $_POST['star'];
$row = "";
//print full star
for ($row = 1; $row <= $star; $row++)
{
 echo "<img style='margin-right:8px;' src='star1.png'>";
}
//print full half star
if($star != $star.'.'){
      echo "<img style='margin-right:8px;' src='star2.png'>";
}
else{
 
 echo"";

}

}
?>

<form method="post">
<input type="text" name="star" />
<hr />
<button type="submit" name="submit"> Submit </button>
</form>

Post A Comment
  • Blogger Comment using Blogger
  • Facebook Comment using Facebook
  • Disqus Comment using Disqus

No comments :

Thanks For visiting Infotech Solutuion Blog