Please login or register. Welcome to the Studio, guest!


Quick Links:



pages

pages Avatar

*
New Member

1


March 2010
Hi first off i know this was last updated a year ago but thank you for putting the time and effort into making such a good tutorial for the basics of a PM system.

However when i try to implement i get a few problems .

My first one is sending messages seems to work fine but viewing the messages is another story entirely , when i click on the message subject the view.php or outview.php screen is completely blank .
If i do the SQL query into phpmyadmin it returns the correct rows so im not sure whats going wrong there. Even the echo statements are not appearing and i'm not being directed back to inbox.php by the
if(!isset($id)) {
header('location: inbox.php');
}

My second problem is all the dates are going slightly crazy , it seems as if its getting the current timestamp instead of the actual time it was sent .
for example 25/m/y 5:20pm is whats displaying for all my sent messages and all the messages in my inbox and it updates to the new time as i refresh it .


Heres the code of my view.php maybe you might find an error with it.

<?php
ob_start();
require_once('auth.php');
require_once('config.php');
require_once('opendb.php');
// view.php

session_start();

if(session_is_registered('SESS_USERNAME')) {
$id = @$_GET['id'];

if(!isset($id)) {
  header('location: inbox.php');
}
elseif(isset($id)) {

$grab_pm = mysql_query("SELECT * FROM `pms` WHERE `touser` = '$touser' AND `id` = '$id'");

while($r= mysql_fetch_object($grab_pm)) {
if($r->read == "0") { $update = mysql_query("UPDATE `pms` SET `read` = '1' WHERE `id` = '$r->id' LIMIT 1"); }

$r->subject = stripslashes($r->subject);
$r->message = stripslashes($r->message);
$r->message = nl2br($r->message);



  echo "<h2>$r->subject</h2>";
  echo "<p>$r->message</p>";
  echo "<p>From: $r->fromuser On: $r->datesent</p>";


}

}

}
ob_end_flush();
?>



Last Edit: Mar 25, 2010 17:24:52 GMT by pages