Jump to content

Blank page error


rofl90

Recommended Posts

I'm getting no errorsin PHPDES08 but heres my code:

 

<?php
session_start();
header("Cache-control: private");
if ($_SESSION["access"] != "granted") {

  header("Location: index.php");
  }
else {



$dbhost = 'x';
$dbuser = 'x';
$dbpass = 'x';
$dbname = 'x';
mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error());

mysql_select_db($dbname);

$action = $_GET['action'];

if(isset($action)) {
if($action == 'send') {
$title = $_POST['title'];
$tox = $_POST['tox'];
$from = $_SESSION["user"];
$message = $_POST['message'];
$time = time();

$queryid = "SELECT * from users where user=$from";
$resultasa = mysql_query($queryid) or die(mysql_error());
$roflmao = mysql_fetch_array($resultasa);
$resultastic = $roflmao['id'];

$queryid2 = "SELECT * from users where user=$tox";
$resultorastic = mysql_query($queryid2) or die(mysql_error());
$resultasticaa = mysql_fetch_array($resultorastic);
$resultasticar = $resultasticaa['id'];
$querymessage = "insert into messages (title, message, fromx, tox, time) VALUES ('$title', '$message', '$resultastic', '$resultasticar', '$time')";

echo "Message sent!";

}
if($action == 'delete') {
$title = $_GET['title'];

$querydel = "delete from messages where title='$title'";
$resultdel = mysql_query($querydel) or die(mysql_error());

echo "Message deleted!";
}
}
?>
<!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" />
<meta http-equiv="description" name="description" content="<?php $result = mysql_query("SELECT * FROM settings") or die(mysql_error()); $row = mysql_fetch_array($result);echo $row['description'];?>" />
<meta http-equiv="keywords" name="keywords" content="<?php $result = mysql_query("SELECT * FROM settings") or die(mysql_error()); $row = mysql_fetch_array($result);echo $row['keywords'];?>" />
<title><?php $result = mysql_query("SELECT * FROM settings") or die(mysql_error()); $row = mysql_fetch_array($result);echo $row['sitetitle'];?> » Private Messages</title>
<link href="http://www.codeetech.com/backend/css/style.css" rel="stylesheet" type="text/css" />
<link href="http://www.codeetech.com/backend/js.php" type="text/javascript"/>
</head>
<body>

<div class="container">

<!-- container START -->
  <div class="innercontainer">
<!-- innercontainer START -->
    <div class="toppart">
    <!-- toppart START -->
    <div class="innertoppart">
       <!-- innertoppart START -->
      <div class="logo"> 
	  <!-- logo START -->
	  <img src="../go/images/headerimg.gif" alt="Codeetech" width="200" height="69" /> 
	  
	  </div>
        <!-- logo END -->
	  <div class="myslogan">
          <!-- myslogan START -->
	    <div class="innermyslogan"> 
		<!-- innermyslogan START -->
		Welcome, <?php
echo $_SESSION['user']; ?>.

		</div>
        <!-- innermyslogan END -->
	  </div>
       <!-- myslogan END -->
    </div>
   <!-- innertoppart END -->
    </div>
<!-- toppart END -->
    <div class="backlinker">
<!-- backlinker START -->Backend Home </div>
<!-- backlinker END -->
<div class="stuff">
<!-- stuff START -->
  <div class="leftmargin">
<!-- leftmargin START -->
<div class="indentmebitch">
<!-- indentmebitch START -->
<table border="0" cellpadding="2" cellspacing="4">
<?php
$toid = $_SESSION["id"];
echo "<tr> <th bgcolor='#F9F9F9'>Title</th> <th bgcolor='#F5F5F5'>From</th><th bgcolor='#F1F1F1'>Time</th></tr>";
$querya = "SELECT * FROM messages where tox='$toid' OR tox='0'";
$resulta = mysql_query($querya) or die(mysql_error());



while($row = mysql_fetch_array($resulta)) {

$from = $row['fromx'];

$queryas = "SELECT * FROM users WHERE id='$from'";
$resultas = mysql_query($queryas) or die(mysql_error());
$fetcher = mysql_fetch_array($resultas);

if(!empty($row['extra'])) {
$printuser = $row['extra'];
}


echo "<tr><td bgcolor='#E5E5E5'><div align='center'><a href='readmessage.php?title=";
echo $row['title'];
echo "&tox=";
echo $row['tox'];
echo "'>";
echo $row['title'];
echo "</a>";
echo "</div></td><td bgcolor='#EBEBEB'><div align='center'>";
echo ucwords(strtolower($printuser));
echo "</div></td><td bgcolor='#ECECEC'><div align='center'>";
echo date('l, jS \of F Y \a\t g:iA',$row['time']);
echo "</div></td></tr>";
}
?>
</table>
</div>
<!-- indentmebitch END -->

</div>
<!-- leftmargin END -->

<div class="right">
<!-- right START -->
  <div class="navigation">
	<!-- nav START -->
Backend:
</div>

	<div class="nav-link"><a href="http://www.codeetech.com/backend/">Backend Home</a></div>
	<div class="nav-link"><a href="http://www.codeetech.com/">View site</a></div>
	<div class="nav-link"><a href="http://www.codeetech.com/backend/pagemanager.php">Page Manager</a></div>
	<div class="nav-link"><a href="http://www.codeetech.com/backend/clientmanager.php">Client Manager</a></div>
	<div class="nav-link"><a href="http://www.codeetech.com/backend/newsmanager.php">News Manager</a></div>
	<div class="nav-link"><a href="http://www.codeetech.com/backend/uploadfile.php">Upload File</a></div>
	<div class="nav-link"><a href="http://www.codeetech.com/backend/settings.php">Settings</a></div>
	<div class="nav-link"><a href="http://www.codeetech.com/backend/profile.php">My Profile</a></div>
	<div class="nav-link"><a href="http://www.codeetech.com/backend/usermanagement.php">User Management</a></div>
	<div class="nav-link"><a href="http://www.codeetech.com/backend/privatemessages.php">Private Messages</a></div>
	<div class="nav-link"><a href="http://www.codeetech.com/backend/sitenavigation.php">Site Navigation</a></div>
	<div class="nav-link"><a href="http://www.codeetech.com/backend/testimonials.php">Testimonials</a></div>
	<div class="nav-link"><a href="http://www.codeetech.com/backend/logout.php">Logout</a></div>									
  </div>
	<!-- nav END -->
		<!-- right END -->
</div>
<!-- stuff END --> 
</div>

 <div class="footer">
<?php
$result = mysql_query("SELECT * FROM settings") or die(mysql_error()); 
$row = mysql_fetch_array($result);
echo $row['footer'];
?>
<!-- innercontainer END -->
</div>
<!-- container END -->
</body>

</html>
<?php
}
?>

Link to comment
Share on other sites

blank pages usually mean an unhandled/shown error. try exiting/echoing at certain points in your script like the top, loads in the middle and then at the bottom to see whats going on. hopefully you will find an exit / echo that does not show up and that will be where the error is

 

i would use one exit("test"); at certain points and move it from top to bottom refreshing as you go, when you get a blnk page the error is between your last/second-to-last exit call.

 

 

hope this helps,

 

(id reccomend notepad++)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.