Location: PHPKode > scripts > Hot or Not Clone > hotornot/viewcomments.php
<?
include("config.php");
include("functions.php");

?>
<script language="JavaScript">
function checkifvalid(){
	if (window.document.myform.comment.value=="")
	{
	alert("please enter the comment!");
	window.document.myform.comment.focus();
	return false;
	}
}
</script>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="stylesheet" href="stylesheet.css" type="text/css">

<title>Rate My Looks</title>
</head>

<body leftmargin="0" rightmargin="0" bottommargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><br>
      <table width="80%" height="10" border="0" align="center" cellpadding="0" cellspacing="0" class="mytable">
        <tr> 
          <td valign="top"> <div align="center"> 
              <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
                  <tr > 
                    <td width="1"  class="header">&nbsp;</td>
                    <td width="100%" height="20" colspan="2" class="header">View 
                      Comments</td>
                  </tr>
				  <?
					$sql="select * from comments where photosid=$phid  and approved='Y' order by postdate desc";
					$res=mysql_query($sql);
					if(mysql_num_rows($res))
					{
					while($obj=mysql_fetch_object($res))
					{
				  ?>
                  <tr class="picsheader"> 
                      <td width="1"  >&nbsp;</td>
                    <td height="25" colspan="2"><? print "Posted by $obj->byusername on ".date("m-d-Y",strtotime($obj->postdate));?></td>
                  </tr>
                  <tr > 
                    <td width="1" >&nbsp;</td>                    
                  <td height="25" colspan="2" class="normal"><? print "$obj->comment";?></td>
                  </tr>
				  <?
					  }
					  }
					  else
					  {
				  ?>
                  <tr class="picsheader"> 
                    
                  <td height="25" colspan="3">No Comments posted on this picture!</td>
                  </tr>
				  <?
				  }
				  ?>
              </table>
            </div></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>
Return current item: Hot or Not Clone