What am I doing wrong with the rating code?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Greg Mott

    What am I doing wrong with the rating code?

    Code:
    <?php
    include('rating/rating.php');
     if ($handle = opendir('upload/')) {
       while (false !== ($file = readdir($handle)))
          {
              if ($file != "." && $file != "..")
    	  {
              	$thelist .= '<tr><td><b>File Name:</b> '.$file.'</td> <td><b>Rating:</b> rating_form('.$file.'); </td> <td><b>Download:</b> <a href="upload/'.$file.'">'.$file.'</a></td></tr>';
              }
           }
      closedir($handle);
      }
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
    	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
    	<meta name="Description" content="" />
    	<title>CraftFiles List</title>	
    	<link rel="stylesheet" type="text/css" href="rating/rating.css" media="screen"/>
    	<script type="text/javascript" src="http://www.google.com/jsapi"></script>
    	<script type="text/javascript">google.load("jquery", "1.3.2");</script>
    	<script type="text/javascript" src="rating/rating.js"></script>
    </head>
    <body>
    <P>List of maps:</p>
    <table border="1">
    <P><?=$thelist?></p>
    </table>
    </body>
    </html>
    Say I wanted to include a rating in any page I could use <?php rating_form("te st1"); ?> but I can't figure out how to get that working with my code right I'm a bit new so go easy on me! If I could figure out the right way to do it I could learn. I know rating_form('.$ file.'); is wrong but I can't figure out how to get it included with my code.
    Last edited by MMcCarthy; Oct 24 '10, 05:53 AM. Reason: added code tags
Working...