Jump to content

PHP Radio Buttons Issue


anim8or

Recommended Posts

I was wondering if someone could help me with a PHP rating script dilemma. I am using DRBRatings script and would like to change the ratings drop down menu to radio buttons. I have tried several times to figure it out myself but end up with nothing more than a headache!

 

I believe I need to change the code in the following lines of the ratings.php.

 


function show_rate_form($id) { 
   global $RATE_THIS_STRING; 
   global $MAX_STARS; 
   global $SUBMIT_BUTTON_STRING; 
   global $RATING_LABELS; 
   global $RATING_LIST_DEFAULT_LABEL; 
   global $RATINGS_URL; 
   global $RATING_ID_PARAM_NAME; 
   global $RATING_PARAM_NAME; 
    
   echo("\t<form class=\"rateIt\" method=\"post\" action=\"" . $RATINGS_URL . "rate.php\">\r\n"); 
   echo("\t\t" . htmlspecialchars($RATE_THIS_STRING) . "\r\n"); 
   echo("\t\t<select name=\"" . htmlspecialchars($RATING_PARAM_NAME) . "\">\r\n"); 
   echo("\t\t\t<option value=\"\">" . htmlspecialchars($RATING_LIST_DEFAULT_LABEL) . "</option>\r\n"); 
   for($i = 1; $i <= $MAX_STARS; $i++) { 
      echo("\t\t\t<option value=\"" . $i . "\">" . $i); 
      if(!empty($RATING_LABELS) && isset($RATING_LABELS[$i])) { 
         echo(" - " . htmlspecialchars($RATING_LABELS[$i])); 
      } 
      echo("</option>\r\n"); 
   } 
   echo("\t\t</select>\r\n"); 
   echo("\t\t<input type=\"hidden\" name=\"" . htmlspecialchars($RATING_ID_PARAM_NAME) . "\" value=\"" . htmlspecialchars($id) . "\" />\r\n"); 
   echo("\t\t<input type=\"submit\" value=\"" . htmlspecialchars($SUBMIT_BUTTON_STRING) . "\" class=\"submit\" />\r\n"); 
   echo("\t</form>\r\n"); 
    
}

 

Any help would be greatly appreciated as I am fairly new to PHP and this is a big problem for my website development.

 

Cheers!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.