Location: PHPKode > scripts > Hot or Not Clone > hotornot/viewprofile.php
<?
$nomember=false;
$sql="select * from members where username='$username' and active=1";
$res=mysql_query($sql);
if($obj=mysql_fetch_object($res))
{
$age=$obj->age;
if($age=="")$age="Not specified";
$gender=$obj->gender;
if($gender=="")$gender="Not specified";
$about=$obj->about;
if($about=="")$about="Not specified";
$city=$obj->city;
if($city=="")$city="Not specified";
$country=$obj->country;
if($country=="")$country="Not specified";
$msn=$obj->msn;
if($msn=="")$msn="Not specified";
$aol=$obj->aol;
if($aol=="")$aol="Not specified";
$yahoo=$obj->yahoo;
if($yahoo=="")$yahoo="Not specified";
$icq=$obj->icq;
if($icq=="")$icq="Not specified";
$fname=$obj->fname;
if($fname=="")$fname="Not specified";
$lname=$obj->lname;
if($lname=="")$lname="Not specified";
}
else
{
$nomember=true;
}
?>
<script language="JavaScript">
function checkifvalid(){
if (window.document.myform.password.value=="")
{
alert("please enter the Password!");
window.document.myform.password.focus();
return false;
}
if (window.document.myform.fname.value=="")
{
alert("please enter the First Name!");
window.document.myform.fname.focus();
return false;
}
if (window.document.myform.email.value=="")
{
alert("please enter the Email!");
window.document.myform.email.focus();
return false;
}
if (window.document.myform.age.value=="")
{
alert("please enter the Age!");
window.document.myform.age.focus();
return false;
}
if (isNaN(window.document.myform.age.value))
{
alert("Age should be a number!");
window.document.myform.age.focus();
return false;
}
if (window.document.myform.city.value=="")
{
alert("please enter the City!");
window.document.myform.city.focus();
return false;
}
if (window.document.myform.country.value=="")
{
alert("please enter the Country!");
window.document.myform.country.focus();
return false;
}
if (window.document.myform.about.value=="")
{
alert("please enter details about yourself!");
window.document.myform.about.focus();
return false;
}
}
</script>
<table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="7%" height="239" align="center" valign="top"> <div align="center"><br>
        <br>
        <br>
      </div></td>
    <td width="93%" align="left" valign="top"> <br>      
      <table width="95%" height="10" border="0" cellpadding="0" cellspacing="0" class="mytable">
        <tr> 
          <td>
		  <div align="center"> 
		  		<?
				if(!$nomember)
				{
				?>
              <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
                <form name="myform" action="index.php?cmd=5" method="post" onsubmit="javascript: return checkifvalid();">
                  <tr > 
                    <td width="5"  class="header">&nbsp;</td>
                    <td height="20" colspan="2" class="header"> Profile of <? print $username;
  ?> </td>
                  </tr>
                  <tr > 
                    <td width="5" height="25" class="normal">&nbsp;</td>
                    <td width="26%" height="25" class="normal"><strong>First Name</strong></td>
                    <td width="74%" height="19" class="normal"> <? print $fname;
  ?></td>
                  </tr>
                  <tr > 
                    <td width="5" height="25" class="normal">&nbsp;</td>
                    <td height="25" class="normal"><strong>Last Name</strong></td>
                    <td height="19" class="normal"> <? print $lname;
  ?></td>
                  </tr>
                  <tr > 
                    <td width="5" height="25" class="normal">&nbsp;</td>
                    <td height="25" class="normal"><strong>Age</strong></td>
                    <td height="19" class="normal"> <? print $age;
  ?></td>
                  </tr>
                  <tr > 
                    <td width="5" height="25" class="normal">&nbsp;</td>
                    <td height="25" class="normal"><strong>Gender</strong></td>
                    <td height="19" class="normal"><FONT 
                  face="MS Sans Serif, Tahoma, Verdana, Arial" size=1> <? if($gender=="M") print "Male"; else print "Female"; ?> </FONT></td>
                  </tr>
                  <tr > 
                    <td width="5" height="25" class="normal">&nbsp;</td>
                    <td height="25" class="normal"><strong>City</strong></td>
                    <td height="19" class="normal"> <? print $city;
  ?></td>
                  </tr>
                  <tr > 
                    <td width="5" height="25" class="normal">&nbsp;</td>
                    <td height="25" class="normal"><strong>Country</strong></td>
                    <td height="19" class="normal"> <? print $country;
  ?></td>
                  </tr>
                  <tr > 
                    <td width="5" height="25" class="normal">&nbsp;</td>
                    <td height="25" class="normal"><strong>MSN id</strong></td>
                    <td height="19" class="normal"> <? print $msn;
  ?></td>
                  </tr>
                  <tr > 
                    <td width="5" height="25" class="normal">&nbsp;</td>
                    <td height="25" class="normal"><strong>AOL id</strong></td>
                    <td height="19" class="normal"> <? print $aol;
  ?></td>
                  </tr>
                  <tr > 
                    <td width="5" height="25" class="normal">&nbsp;</td>
                    <td height="25" class="normal"><strong>YAHOO id</strong></td>
                    <td height="19" class="normal"> <? print $yahoo;
  ?></td>
                  </tr>
                  <tr > 
                    <td width="5" height="25" class="normal">&nbsp;</td>
                    <td height="25" class="normal"><strong>ICQ id</strong></td>
                    <td height="19" class="normal"> <? print $icq;
  ?></td>
                  </tr>
                  <tr > 
                    <td width="5" height="25" class="normal">&nbsp;</td>
                    <td height="25" class="normal"><strong>About myself</strong></td>
                    <td height="19" class="normal"> <? print $about;
  ?></td>
                  </tr>
                  <tr align="center" > 
                    <td height="25" colspan="3" class="normal"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr align="center"> 
                          <td><a href="index.php?cmd=19&username=<? print $username; ?>">Send 
                            a message</a></td>
                          <td><a href="index.php?username=<? print $username; ?>">View 
                            <? print $username; ?>'s Pictures</a></td>
                          <td><a href="index.php">Back to Main Pages</a></td>
                        </tr>
                      </table></td>
                  </tr>
                </form>
              </table>
			  <?
			  }
			  else
			  {
			  ?>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
                <form name="myform"  method="post" action="index.php" >
                  <input type="hidden" name="photoid2" value="<? print $photoid; ?>">
                  <tr > 
                    <td width="98%" height="19" class="header">No member exists 
                      with that username!</td>
                  </tr>
                </form>
              </table>
			  <?
			  }
			  ?>
            </div></td>
        </tr>
      </table>
      <br>
    </td>
  </tr>
</table>
Return current item: Hot or Not Clone