1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Making A Better PHP System(Need Help!!)

Discussion in 'PHP' started by Spudster, Mar 26, 2012.

  1. #1
    Can someone modfi this from using sessions to something more better, when i ban a user they wont be banned untill they login again, Need something that will say if theres 1 in the database for that user then kill the script, Next time they refresh the page, It be alot easier and better, or something that can destroy the sessions if it == 1 so they have to login again.

    When i ban them there not really banned till they login again, so something else that ould verifi the 1 (which = the user is banned in the database)

    Heres a snapshot of the database structure


    http://admintalk.net/imagehost/spudster/usrrs2.jpg





    
    <?php
    session_start();
    
    include ("connection.php");
    if ($_SESSION['banned'] == 1)
    die ("Your Account Has Been Disabled, Please Contact An Administrator!");
    
    
    ?>
    Code (markup):

    SEMrush
     
    Spudster, Mar 26, 2012 IP
    SEMrush
  2. stasiek

    stasiek Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #2
    Hi,
    just check whether the user is banned in database by checking it:

    
    
    <?php
    session_start();
    include ("connection.php");
    
    //taking data from database
    if ($row['banned'] == 1)
    die ("Your Account Has Been Disabled, Please Contact An Administrator!");
    
    ?>
    
    Code (markup):
     
    stasiek, Mar 27, 2012 IP