TheFilmGod Posted March 16, 2007 Share Posted March 16, 2007 Hi. I need help with some php. I need to change a bit of it. Right now I have a 5 star rating script on my page, but instead of clicking on the stars to vote, users click on radio buttons. I'd like to change this. I'm not the best in php, but I hope you can help me out. echo '<input type="radio" value="5" name="rating_'.$page.'" id="rate5_'.$page.'" />Excellent<br>'; echo '<input type="radio" value="4" name="rating_'.$page.'" id="rate4_'.$page.'" />Very Good<br>'; echo '<input type="radio" value="3" name="rating_'.$page.'" id="rate3_'.$page.'" />Good<br>'; echo '<input type="radio" value="2" name="rating_'.$page.'" id="rate2_'.$page.'" />Fair<br>'; echo '<input type="radio" value="1" name="rating_'.$page.'" id="rate1_'.$page.'" />Poor<br>'; echo '<input type="hidden" name="rs_id" value="'.$page.'" />'; echo '<input type="submit" name="rate'.$page.'" value="Rate" />'; } else { echo '<input type="radio" value="1" name="rating_'.$page.'" id="rate5_'.$page.'" />1'; echo '<input type="radio" value="2" name="rating_'.$page.'" id="rate4_'.$page.'" />2'; echo '<input type="radio" value="3" name="rating_'.$page.'" id="rate3_'.$page.'" />3'; echo '<input type="radio" value="4" name="rating_'.$page.'" id="rate2_'.$page.'" />4'; echo '<input type="radio" value="5" name="rating_'.$page.'" id="rate1_'.$page.'" />5<br>'; echo '<input type="hidden" name="rs_id" value="'.$page.'" />'; echo '<input type="submit" name="rate'.$page.'" value="Rate" />'; } Can you help me by giving any insight on how to change this so visitors can click on the stars to vote, or a picture of a star? I really hate radio buttons. Any help is greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/42929-sexy-php-code-help/ Share on other sites More sharing options...
Barand Posted March 16, 2007 Share Posted March 16, 2007 I cannot see how this is a PHP problem. Get it working how you want it to work with a static HTML page then use PHP to output the working HTML code. Link to comment https://forums.phpfreaks.com/topic/42929-sexy-php-code-help/#findComment-208510 Share on other sites More sharing options...
amandas Posted March 16, 2007 Share Posted March 16, 2007 You would need to use CSS to put a star background for the radio buttons. http://ryanfait.com/articles/2007/01/05/custom-checkboxes-and-radio-buttons/ Hope this helps. Link to comment https://forums.phpfreaks.com/topic/42929-sexy-php-code-help/#findComment-208632 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.