Jump to content

Whats wrong with this code?


garydt

Recommended Posts

	session_start();
$disc = $_GET['topic'];	
$logon = ($_SESSION['MM_Username']);

mysql_select_db($database_elvisdb, $elvisdb);
$query_Recordset6 = "SELECT * FROM discussions WHERE discnum='$disc'";
$Recordset6 = mysql_query($query_Recordset6, $elvisdb) or die(mysql_error());
$row_Recordset6 = mysql_fetch_assoc($Recordset6);
$top = $row_Recordset6['topic'];
$prv = $row_Recordset6['private'];
$u = $row_Recordset6['user'];
$u1 = $row_Recordset6['user1'];
$u2 = $row_Recordset6['user2'];
$u3 = $row_Recordset6['user3'];
$u4 = $row_Recordset6['user4'];
$u5 = $row_Recordset6['user5'];
$totalRows_Recordset6 = mysql_num_rows($Recordset6);

if ($prv=="Yes") {
if ($logon=='') {
header("Location: login.php");
}
if ($logon!='$u') {
header("Location: forum.php");
} else {
}
}  

 

I've made a forum where users can create private discussions where upto 5 other users are allowed in the discussions.

$logon is the current logged on user and $u is one of the allowed users.

If the allowed user is logged on and tries to view the private discussion it won't let them. It also doesn't let any user view the private discussion which doesn't makes sence.

What have i got wrong?

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.