php forum menu

Shout-Out

User Tag List

Thread: php forum

Results 1 to 4 of 4
  1. #1
    Le Froid's Avatar Contributor
    Reputation
    172
    Join Date
    Mar 2007
    Posts
    1,327
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php forum

    I was messing around with a forum code earlier since I just added a user system to it but when I try to post something it doesn't include the username under the part where it says "Username:" :|
    Does anyone know what is wrong with

    Code:
    <html><body background="images/blue-bg.png"><title>Forums</title>
    <?
    ob_start();
    session_start( );
    require_once($_SERVER['DOCUMENT_ROOT'].'/indev/connect.php');
    
    //check cookie
     if ($_SESSION['logged_in'] != 1 && isset($_COOKIE['login_cookie'])) {
        list($user, $pass) = explode('[]', $_COOKIE['login_cookie']);
         $qu = mysql_query("SELECT `user_password` FROM `members` WHERE `username` = '".addslashes($user)."'");
        if (mysql_num_rows($qu) == 1) {
            $passw = mysql_fetch_object($qu);
            if ($passw->user_password == $pass) {
              $_SESSION['logged_in'] = 1;
               $_SESSION['username'] = $user;
                $_SESSION['password'] = $pass;
            }
        }
     }
    
    if(!isset($_SESSION['username']) && !isset($_SESSION['password'])) {
       $_SESSION['logged_in'] = 0;
       $user = "Guest"; 
     }
    
    
    $id=$_GET['id'];
    
    print "<link rel='stylesheet' href='style.css' type='text/css'>";
    
    print "<A href='index.php'>Back</a>-<A href='post.php'><img border='0' src='images/newthread.gif'</a>-<A href='reply.php?id=$id'><img border='0' src='images/reply.gif'<br>";
    
    print "<table class='maintable'>";
    
    print "<tr class='headline'><td width=20%>User</td><td width=80%>Post</td></tr>";
    
    $gettopic="SELECT * from forumtutorial_posts where postid='$id'";
    //$userid="SELECT * from members where user_id='$uID'";
    
    $gettopic2=mysql_query($gettopic) or die("Could not get topic");
    //$userid2=mysql_query($userid) or die("Could not find poster");
    
    $gettopic3=mysql_fetch_array($gettopic2);
    //$userid3=mysql_fetch_array($userid2);
    
    print "<tr class='mainrow'><td valign='top'>$_SESSION[username]</td><td vakign='top'>Last replied to at $gettopic3[showtime]<br><hr>";
    
    $message=strip_tags($gettopic3['post']);
    
    
    $message=nl2br($message);
    
    print "$message<hr><br>";
    
    print "</td></tr>";
    
    $getreplies="Select * from forumtutorial_posts where parentid='$id' order by postid desc"; //getting replies
    //$userid="Select * from members where username='$user'";
    
    $getreplies2=mysql_query($getreplies) or die("Could not get replies");
    //$userid2=mysql_query($userid) or die("Could not recieve username");
    
    while($getreplies3=mysql_fetch_array($getreplies2))
    //while($userid3=mysql_fetch_array($userid2))
    
    {
    
       print "<tr class='mainrow'><td valign='top'>$_SESSION[username]</td><td vakign='top'>Last replied to at $getreplies3[showtime]<br><hr>";
    
       $message=strip_tags($getreplies3['post']);
    
       $message=nl2br($message);
    
       print "$message<hr><br>";
    
       print "</td></tr>";
    
    }
    
    print "</table>";
    
    
    
    ?>

    php forum
  2. #2
    PolitisktNamn's Avatar Member
    Reputation
    8
    Join Date
    Jun 2007
    Posts
    81
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've haven't come so far in php forums yet,But try to undo what you did wrong or something ?

  3. #3
    Le Froid's Avatar Contributor
    Reputation
    172
    Join Date
    Mar 2007
    Posts
    1,327
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Eh just re-wrote entire thing with a new $_SESSION value and it worked.

  4. #4
    2dgreengiant's Avatar ★ Elder ★


    Reputation
    1192
    Join Date
    Feb 2007
    Posts
    7,129
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yoink *steals this php*
    If you need me you have my skype, if you don't have my skype then you don't need me.

Similar Threads

  1. Replies: 0
    Last Post: 11-29-2011, 05:48 PM
  2. [PHP] Forum System
    By SpellEffects in forum Programming
    Replies: 10
    Last Post: 07-19-2011, 01:47 PM
  3. [Release] ColorMe php forums
    By Nathan72389 in forum Community Chat
    Replies: 4
    Last Post: 06-27-2010, 10:18 AM
  4. [REQUEST] Forum PHP script
    By sasoritail in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 01-24-2009, 04:51 AM
  5. [request] PhP forum WoW Design
    By xaverz in forum Art & Graphic Design
    Replies: 0
    Last Post: 05-21-2008, 11:28 AM
All times are GMT -5. The time now is 07:36 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search