I am working on a site now and everything was working 5 minutes ago and now all of a sudden it stopped working. here is the coding where the error seems to be located:
<?
if($delrap==1){
$sql = "DELETE FROM rapsheets WHERE `index`='$rapid'";
$result = @mysql_query($sql) or die("couldn't execute query .".mysql_error());
}
$totalraps=0;
$sql = "SELECT * FROM rapsheets WHERE `userid`='$id'";
$result = @mysql_query($sql) or die("couldn't execute query $sql.".mysql_error());
while($row = mysql_fetch_array($result)) {
$totalraps++;
}
if($totalraps==0){
echo "<font class=profile_text><b>No Comments at this time</i></font><p>\n";
} else {
echo "<table border=0 width=450 align=center cellpadding=10 cellspacing=0>\n";
if($startrap>0){ } else { $startrap=0; }
$endrap=$startrap+5;
$sql = "SELECT * FROM rapsheets WHERE `userid`='$id' ORDER BY `index` DESC LIMIT $startrap,$endrap";
$result = @mysql_query($sql) or die("couldn't execute query .".mysql_error());
while($row = mysql_fetch_array($result)) {
$posterid=$row{'posterid'};
$posterpic=$row{'posterpic'};
$postercomment=$row{'postercomment'};
$posterdate=$row{'posterdate'};
$postername=$row{'postername'};
$rapid=$row{'index'};
$posterpic=str_replace("/userimage","userimage",$posterpic);
$now = time();
$timestamp=$row{'timestamp'};
echo "<tr><td align=center>\n";
echo "<table cellpadding=0 cellspacing=0 width=450 align=center style=\"border:1px #c0c0c0 dotted;\">\n";
echo "<tr>\n";
echo "<Td valign=top align=center width=125 rowspan=2>\n";
echo "<a href=viewprofile.php?id=$posterid><img src=image.php?imagefile=$posterpic border=0></a>\n";
echo "</td>\n";
echo "<td align=left class=profile_text valign=top height=10>\n";
echo "<a href=viewprofile.php?id=$posterid><b>$postername</a> - $posterdate</b>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class=profile_text valign=top height=50>\n";
echo "$postercomment\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</td></tr>\n";
if($now-$timestamp>3600*12 && $id==$userid){
echo "<tr><td align=center><a href=viewprofile.php?delrap=1&rapid=$rapid&id=$id>DELETE</a></td></tr>\n";
} else {
echo "</table>\n";
if($totalraps>5){
for($a=1;$a<=$totalraps;$a++){
$b=$a*5-4;
echo "| <a href=viewprofile.php?id=$id&startrap=$b>$a</a> |";
}
}
}
echo "<br>";
if($userid>0){
if($addrap==1){
$sql = "SELECT * FROM users WHERE `userid`='$userid'";
$result = @mysql_query($sql) or die("couldn't execute query .$sql".mysql_error());
while($row = mysql_fetch_array($result)) {
$userpic=$row{'userpic'};
}
$sql = "SELECT * FROM pictures WHERE `index`='$userpic'";
$result = @mysql_query($sql) or die("couldn't execute query .".mysql_error());
while($row = mysql_fetch_array($result)) {
$userpic=$row{'picfile'};
}
$postdate=Date("F j, Y g:i A");
$timestamp=time();
$sql = "INSERT INTO rapsheets (userid,posterid,posterpic,postername,postercomment,posterdate,timestamp) VALUES (\"$id\",\"$userid\",\"$userpic\",\"$username\",\"$addcomment\",\"$postdate\",\"$timestamp\");";
$result = @mysql_query($sql) or die("couldn't execute query .".mysql_error());
echo "<table border=0 cellpadding=10 cellspacing=0>\n";
echo "<tr><Th class=text>Rapsheet Added!</th></tr>\n";
echo "</table>\n";
} else {
echo "<form action=viewprofile.php method=post>\n";
echo "<input type=hidden name=addrap value=1>\n";
echo "<input type=hidden name=id value=$id>\n";
echo "<table border=0 width=510 align=center cellpadding=10 cellspacing=0>\n";
echo "<tr><Th class=text>Post A Comment</th></tr>\n";
echo "<tr><th><textarea name=addcomment rows=8 cols=50 class=input_profile></textarea></th></tr>\n";
echo "<Tr><th><input type=submit value=Post style=\"border: 1px SOLID #ff0000; color: FFFFFF; background-color: 000000;\"></th></tr>\n";
echo "</table>\n";
}
}
?>
let me know if you see anything it is saying there is an error located at the bottom of my document, yet there is nothing at the bottom of my document.