PDA

View Full Version : PHP Helpish



:Edzy
14-11-2007, 06:10 PM
Why Can't i Add Html into the database to show o.O?

please helpp :D


<?
include '../includes/functions.php';
include '../includes/replace.php';
logincheck();
$info=mysql_fetch_object(mysql_query("SELECT rank,money,crew FROM users WHERE username='$username'"));


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="../stylesheets/online.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body,td,th {
color: #FFFFFF;
}
body {
background-color: #4f4f4f;
}
-->
</style></head>
<?

$view=$_GET['viewuser'];

$fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$view'"));
$refs=mysql_num_rows(mysql_query("SELECT username FROM users WHERE referal='$fetch->username'"));
$crew=mysql_fetch_object(mysql_query("SELECT * FROM crews WHERE name='$crew'"));
if($_POST['bad']){
echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=help.php?type=Complaint&text=Bad Profile For Username - $viewuser .

Reason For Report: \">";
}
$rows=mysql_num_rows(mysql_query("SELECT * FROM users WHERE username='$view'"));
if($rows == "0"){
print "User not found !";
exit();
}

if($fetch->crew == "0"){
$crew="None";
}else{
$crew=$fetch->crew;
}

$users_image=$fetch->image;
$quote=$fetch->quote;

$reg=$fetch->regged;
$time=time();
$sum=$time-$reg;
if($sum < 86400){
$days=1;
}else{
$days=round(($sum)/(86400));
}

if($fetch->money < "500000"){
$wel="Lower Class";
}elseif($fetch->money < "5000000"){
$wel="Middle Class";
}elseif($fetch->money >= "5000000"){
$wel="Upper Class";
}

?>

<body>
<table width="70%" height="438" border="0" cellspacing="0" align="center" class="background">
<tr class="header">
<td colspan="2">Profile for <? print"$view"; ?></td>
</tr>
<tr>
<td colspan="2" class="background"><div align="center"><img src="<? print"$users_image"; ?>" alt="Users Image" name="image" width="" height="" id="image" /></div></td>
</tr>
<tr>
<td width="167" height="20" class="background"><strong>Username</strong></td>
<td width="232" class="background"><a href='send.php?fromper=<? print"$fetch->username"; ?>'><? print"$fetch->username"; ?></a></td>
</tr>
<tr>
<td class="background"><strong>Status</strong></td>
<td class="background"><? print"$fetch->status"; ?></td>
</tr>
<tr>
<td class="background"><strong>Social Class</strong></td>
<td class="background"><? print"$wel"; ?></td>
</tr>
<tr>
<td class="background"><strong>Crew</strong></td>
<?
if($crew == "None"){?>
<td class="background"><? print"$crew";?></td>
<? }else{
$crew=mysql_fetch_object(mysql_query("SELECT * FROM crews WHERE name='$crew'")); ?>
<td class="background"><? print"<a href='crewprofile.php?crewid=$crew->id'>$crew->name</a>";?></td>
<? } ?>
</tr>
<tr>
<td class="background"><strong>Rank</strong></td>
<td class="background"><? print"$fetch->rank"; ?></td>
</tr>
<tr>
<td class="background"><strong>Days Playing </strong></td>
<td class="background"><? print "".makecomma($days).""; ?></td>
</tr>
<tr>
<td class="background"><strong>Referals</strong></td>
<td class="background"><? print "".makecomma($refs).""; ?></td>
</tr>
<tr>
<td colspan="2" class="header">Quote
<? if($username == $view){
print"<a href='edit_profile.php'> - Edit Your Profile</a>";
} ?> </td>
</tr>
<tr>
<td colspan="2" class="background"><? print"".replace($quote).""; ?></td>
</tr>
</table>

<p>&nbsp;</p>
<form id="form1" name="form1" method="post" action="">
<div align="center">
<input name="bad" type="submit" class="button" id="bad" value="Repord Bad Profile Content" />
</div>
</form>
<p>
<? if ($info->rank == 'Civilian'){ ?>
</p>
<table width="386" border="0" align="center" cellspacing="0" class="help">
<tr>
<th width="49" scope="col"><a href="help.php?type=Complaint"><img src="../images/question mark.jpg" alt="Click To Contact Staff For Help" name="help" width="49" height="46" border="0"></a></th>
<th width="333" scope="col"><div align="left">
This is the profile page! Here you can see the information of the player you choose to look at and the picture, music and information they input themselves! The information is up to date to the time you click on it!. If you think a profile takes too long to load (depending on your connection) or shows abusive material please contact an admin / mod straight away!
</div></th>
</tr>
</table></body>
<? } ?>
</html>
<? include_once 'footer.php'; ?>

regards,

Ed

Want to hide these adverts? Register an account for free!