php forum index

C++, C#, Java, PHP, ect...
Post Reply
User avatar
VZdemon
Posts: 93
Joined: Thu Nov 25, 2010 1:55 pm

php forum index

Post by VZdemon »

i'm currently working on a forum that i personally coded and i get this problem with. see i made a userpanel that appears in every page, but in the forum index page it's black background-image doesn't appear when i load the page.
here is the code please help.

Code: Select all

<html>
	<head>
    	<title>Forum</title>
        <style type="text/css">
			 body{
				font-family:"Zrnic Rg";
				font-size:14px;
				background-color:#00F;
				color:#00FF66;
				text-decoration:none;
			 }
			#holder{
				width:90%;
				color:#000;
				font-family:"Zrnic Rg";
				font-size:14px;
				border:1px solid #000;
				padding:10px;
				text-align:left;
				top:500px;
			}
			#userpanel {
				font-family:"Zrnic Rg";
				font-size:14px;
				background-image:url(images/newspad.png);
				position:absolute;
				right:1px;
				top:10px;
				width:auto;
				height:auto;
			}
		</style>
    </head>
    <body text="#00FF66" link="#990000" vlink="#CC0000">
		<div id='holder'>
        	<?php
			echo "hello";
			?>
        </div>
        <div id="userpanel">
        	<?php
			include "connect.php";
			include "authenticate.php";
			if (isset($_SESSION['user'])){
				$user = $_SESSION['user'];
				$get = "SELECT * FROM users WHERE name='$user'";
				$query = mysql_query($get) or die(mysql_error());
			    $array = mysql_fetch_array($query) or die(mysql_error());
				$profpic = $array['picid'];
				$title = $array['title'];
				$rank = $array['rank'];
				$exp = $array['exper'];
				$mxp = $array['mxp'];
				$admin = $array['admin'];
				if($exp >= $mxp){
						$newr = $rank + 1;
						$newx = 0;
					    $newm = $mxp + $rank * 2;
					    $update = "UPDATE exper='$newx rank='$newr' maxp='$newm'";
				}else{
					$newr = $rank;
					$newx = $exp;
					$newm = $mxp;
				}
				echo "<center><big><b>" . $user . "</b><br></big></center>";
				echo "<img src = '$profpic'  width='100' hieght='100' /><br/>";
				echo "<b>" . $array['title'] . "</b><br/>";
				echo "Rank: " . $newr . "<br/>";
				echo "Exp: " . $newx  . "/" . $newm . "<br/>";
				echo " <a href='logout.php'>Logout</a> | <a href='settings.php'>Profile</a><br/>";
				if ($admin==1){
					echo "<a href='admin.php'>admin panel</a>";
				}
				}else{
					echo "<a href='login.php'>Login</a> | <a href='registerform.php'>Register</a>";
				}
                ?>
        	</div>
    </body>
</html> 
Image
it's VZdaemon on xbox live
User avatar
kaos78414
Posts: 507
Joined: Thu Jul 22, 2010 5:36 am

Re: php forum index

Post by kaos78414 »

Try changing the background url to

Code: Select all

background:#000 url("..images/newspad.png");
w00t
User avatar
VZdemon
Posts: 93
Joined: Thu Nov 25, 2010 1:55 pm

Re: php forum index

Post by VZdemon »

thanks. the bug is fixed.
it's VZdaemon on xbox live
Post Reply

Return to “Coding”