Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Mar 2012
    Posts
    55
    Member #
    31209
    Hi!

    I need a php/html forum so members can chat. almost like "WebDesignForums" I need it so the post say who its by. All the one's I tried, do see to work. Here are all the Scrips:

    class.login.php
    PHP Code:
    <?php

    class Login
    {
      private 
    $_id;
      private 
    $_username;
      private 
    $_password;
      private 
    $_passmd5;

      private 
    $_errors;
      private 
    $_access;
      private 
    $_login;
      private 
    $_token;

      public function 
    __construct()
      {
        
    $this->_errors = array();
        
    $this->_login  = isset($_POST['login'])? 0;
        
    $this->_access 0;
        
    $this->_token  $_POST['token'];

        
    $this->_id      0;
        
    $this->_username = ($this->_login)? $this->filter($_POST['username']) : $_SESSION['username'];
        
    $this->_password = ($this->_login)? $this->filter($_POST['password']) : '';
        
    $this->_passmd5  = ($this->_login)? md5($this->_password) : $_SESSION['password'];
      }

      public function 
    isLoggedIn()
      {
        (
    $this->_login)? $this->verifyPost() : $this->verifySession();

        return 
    $this->_access;
      }

      public function 
    filter($var)
      {
        return 
    preg_replace('/[^a-zA-Z0-9]/','',$var);
      }

      public function 
    verifyPost()
      {
        try
        {
          if(!
    $this->isTokenValid())
            throw new 
    Exception('Invalid Form Submission');

          if(!
    $this->isDataValid())
            throw new 
    Exception('Invalid Form Data');

          if(!
    $this->verifyDatabase())
            throw new 
    Exception('Invalid Username/Password');

        
    $this->_access 1;
        
    $this->registerSession();
        }
        catch(
    Exception $e)
        {
          
    $this->_errors[] = $e->getMessage();
        }
      }

      public function 
    verifySession()
      {
        if(
    $this->sessionExist() && $this->verifyDatabase())
          
    $this->_access 1;
      }

      public function 
    verifyDatabase()
      {
        
    //Database Connection Data
        
    mysql_connect("IP""user""pass") or die(mysql_error());
        
    mysql_select_db("dataname") or die(mysql_error());

        
    $data mysql_query("SELECT ID FROM users WHERE username = '{$this->_username}' AND password = '{$this->_passmd5}'");

        if(
    mysql_num_rows($data))
          {
            list(
    $this->_id) = @array_values(mysql_fetch_assoc($data));
            return 
    true;
          }
        else
          { return 
    false; }
      }

      public function 
    isDataValid()
      {
        return (
    preg_match('/^[a-zA-Z0-9]{5,12}$/',$this->_username) && preg_match('/^[a-zA-Z0-9]{5,12}$/',$this->_password))? 0;
      }

      public function 
    isTokenValid()
      {
        return (!isset(
    $_SESSION['token']) || $this->_token != $_SESSION['token'])? 1;
      }

      public function 
    registerSession()
      {
        
    $_SESSION['ID'] = $this->_id;
        
    $_SESSION['username'] = $this->_username;
        
    $_SESSION['password'] = $this->_passmd5;
      }

      public function 
    sessionExist()
      {
        return (isset(
    $_SESSION['username']) && isset($_SESSION['password']))? 0;
      }

      public function 
    showErrors()
      {
        echo 
    "<h3>Errors</h3>";

        foreach(
    $this->_errors as $key=>$value)
          echo 
    $value."<br>";
      }
    }

    ?>
    csstemplate.inc

    Code:
    <!DOCTYPE html>
    
    <html>
    <head>
    <title>Yoshee08-Home</title>
    <link rel="stylesheet" type="text/css" href="/menu/menu_style.css" />
    </head>
    <body bgcolor=#f87217>
     
    <table height="100" width="625" background="http://www.yoshee08.com/bluebg.jpg"
    align="center">
    <tr><td><center><a href="http://www.yoshee08.com"><img  src="http://yoshee08.com/yoshee;s%20logo.JPG" ></a></center></td></tr>
    </table>
    <br>
     
    <style media="all" type="text/css">@import "/menu/menu_style.css";</style>
    <!--[if IE]>
        <style media="all" type="text/css">@import "/menu/ie.css";</style>
    <![endif]-->
    <div class="nav">
    <div class="table">
    <ul class="select"><li><a href="http://www.yoshee08.com" target="_self"><b>Home</b></a>
    <div class="select_sub">
    <ul class="sub">
    <li><a href="http://www.yoshee08.com/adminlogin" target="_self">Admin Login</a></li>
    <li><a href="http://www.yoshee08.com/adminsite" target="_self">Admin Site </a></li>
    <li><a href="http://www.yoshee08.com/logout" target="_self">Logout</a></li>
    <div class="select_sub">
    <ul class="sub">
    <li><a href="http://www.godaddy.com" target="_self">Godaddy</a></li>
    </ul>
    </div>
    </ul>
    </div>
    </li>
    </ul>
    <ul class="select"><li><a href="http://www.yoshee08.com/Games" target="_self"><b>Games</b></a>
    <div class="select_sub">
    <ul class="sub">
    <li><a href="http://www.yoshee08.com/Games/thequest.php" target="_self">The Quest</a></li>
    <li><a href="http://www.yoshee08.com/Games/parapop.php" target="_self">Parapop</a></li>
    <li><a href="http://www.yoshee08.com/Games/mrmonster.php" target="_self">Mr. Monster</a></li>
    <li><a href="http://www.yoshee08.com/Games" target="_self">More.....</a></li>
    </ul>
    </div>
    </li>
    </ul>
    <ul class="select"><li><a href="http://www.yoshee08.com/join" target="_self"><b>Join</b></a>
    </li>
    </ul>
    <ul class="select"><li><a href="http://www.yoshee08.com/music" target="_self"><b>Music</b></a>
    </li>
    </ul>
    <ul class="select"><li><a href="http://www.yoshee08.com/login" target="_self"><b>Login</b></a>
    </li>
    </ul>
    <ul class="select"><li><a href="http://www.yoshee08.com/email" target="_self"><b>Email</b></a>
    </li>
    </ul>
    <ul class="select"><li><a href="http://scouting.yoshee08.com" target="_self"><b>Troop 3 Website</b></a>
    </li>
    </ul>
    <ul class="select"><li><a href="http://troop3.yoshee08.com" target="_self"><b>Troop 3 Blog</b></a>
    </li>
    </ul>
    <ul class="select"><li><a href="http://www.yoshee08.com/members" target="_self"><b>Members</b></a>
    <div class="select_sub">
    <ul class="sub">
    <li><a href="http://www.yoshee08.com/members/myprofile.php" target="_self">My Profile</a></li>
    </ul>
    </div>
    </li>
    </ul>
    </div>
    </div>
    A base page (index.php) HOME

    Code:
    <?php
    session_start();
    
    include('class.login.php');
    include 'csstemplate.inc';
    
    $login = new Login();
    
    ?>
    
    <table border="0" align="center">
    <td><h1>Home</h1>
    <? if($login->isLoggedIn())
    echo " <b>Welcome \"{$_SESSION['username']}\"!  </b>";
    else 
    
    echo " <b>Welcome \"Guest\"! </b>";
    ?>
    <br />
    <h1>ATTENTION!</h1><br>
    <p>
    We are going to update our Website theme! <br> so you might see things messed up for a few days. <br>
    So please check back later for a more user friendly interface!
    </p>
    <br>This club is for kids who want to have fun! so have fun!</td>
    </table>
    </body>
    </html>
    can someone at least give me the base?

    Thanks in advance!

  2.  

  3. #2
    Member
    Join Date
    Apr 2012
    Posts
    45
    Member #
    31415
    Liked
    13 times
    The PHP class is merely for user login. There's nothing in it that is actually a forum.

    Have you looked at 3rd party forums? This forum, for instance, is powered by XenForo.
    Moderator at PHPFreaks

  4. #3
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    http://www.hotscripts.com/category/s...ussion-boards/

    Tons of then, most decent hosting providers have some scripts already installed, and by clicking a few buttons they will install one that have been configured and tested for their systems...

    Might want to look there first.

  5. #4
    Junior Member
    Join Date
    Apr 2012
    Posts
    12
    Member #
    31568
    I personally like SMF Forums (free) or vBulletin (paid)

  6. #5
    Member
    Join Date
    Mar 2012
    Posts
    55
    Member #
    31209
    Thanks guys! i used one from Webzarus!

    It worked!

    Thanks

  7. #6
    Junior Member
    Join Date
    May 2012
    Posts
    3
    Member #
    31612
    vBulletin seems to be the best.

  8. #7
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,657
    Member #
    1234
    Liked
    138 times
    Quote Originally Posted by Miko001, post: 234770
    vBulletin seems to be the best.
    We used to use it, but we currently use XenForo here.

    FYI, vB's suing XF. LOOOOOONG story.
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:32 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com