...

View Full Version : blank screen nothing shows up



westes
08-13-2008, 02:28 PM
I am tying to make a forum and i get a blank screen off this script


<?php
session_start();
include "./globl.php";
?>
<HTML>

<head>
<title>Will's Fourm</title>

<style type="text/css">
body {
background-color:#EEE;
color:#000;
font-family:Arial;
font-size:10pt;
}

#holder {
width:90%;
color#000;
font-family:Arial;
border:1px solid #000;
padding:10px;
text-align:left;
}

#userInfo {
width:100%;
color:#000;
font-family: Arial
border:1px solid #CCC;
text-anign:left:
padding:3px;
}
</style>
</head>

</body>
<center>
<div id="holder">

<div if=userInfo>
<?php

if($_SESSION['uid']) {
$sql = "SELECR username FROM 'users WHERE 'id'='".$_SESSION['uid']."'";
$res = mysql_query($sql) or die(mysql_error());

if(mysql_num_rown($res) == 0 {
session_destroy();
echo "Please <a href=\"./login.php\">Login</a> to your account or <a href=\"./register.php\">Register</a> a new account!\n";
}else {
$row = mysql_fetch_assoc($res);
echo "Welcome Back!<a href=\"./index.oho?act=profile&id=".$row['id']."\">".$row['username']."</a>!\n";


}else {
echo "Please <a href=\"./login.php\">Login</a> to your account or <a href=\"./register.php\">Register</a> a new account!\n";
}
?>
<?php

?>
</div
</center
</body>
</HTML>

abduraooft
08-13-2008, 02:37 PM
Add

<?php
error_reporting(E_ALL);
ini_set('display_errors','On');
?>
at the top of your page.

westes
08-13-2008, 10:23 PM
Did this not show errors it must not be a php:confused:

peteyb383
08-13-2008, 10:52 PM
Is $SESSION_['uid'] set? If it is, there are a lot of minor mistakes in your code that could cause your problem.



<div id="userInfo">
<?php

if($_SESSION['uid']) {
$sql = "SELECT `username` FROM `users` WHERE id='".$_SESSION['uid']."'";
$res = mysql_query($sql) or die(mysql_error());

if(mysql_num_rows($res) == 0) {
session_destroy();
echo "Please <a href=\"./login.php\">Login</a> to your account or <a href=\"./register.php\">Register</a> a new account!\n";
}else {
$row = mysql_fetch_assoc($res);
echo "Welcome Back!<a href=\"./index.php?act=profile&id=".$row['id']."\">".$row['username']."</a>!\n";
// I'm guessing the above line should've had a php extension.

}else {
echo "Please <a href=\"./login.php\">Login</a> to your account or <a href=\"./register.php\">Register</a> a new account!\n";
}
?>
</div>

The lines I edited are in red.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum