Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: session>> need help!

  1. #1
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default session>> need help!

    Maybe someone can teach how to create session and where it must be placed in pages... i want, that not registered people cant access other pages.
    I will be thankfull for your help

  2. #2
    Join Date
    Apr 2009
    Location
    Cognac, France
    Posts
    400
    Thanks
    2
    Thanked 57 Times in 57 Posts

    Default

    This is a good link to show you how to use SESSIONS, use the Next button to read all of it.

    http://php.about.com/od/advancedphp/ss/php_sessions.htm

  3. #3
    Join Date
    Oct 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    if you want good php login download this I am the author of that one I can assist you on that. http://sourceforge.net/projects/phploginsystemw/

  4. #4
    Join Date
    Oct 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    if you want another visit evolt.org http://evolt.org/node/60384

  5. #5
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default

    thanks... that may help me but it seems to difficult to me. I dont know how to use your system. What i have to change? to fit my web?
    <i have login system, but yours seems better>

  6. #6
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    It's easier than it seems. Additionally, if SESSION is too complex for you, you can use COOKIE instead to read logins -- not as effective, but it'd getcha by.
    - Josh

  7. #7
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    actually, my two cents would go for SESSION being a lot simpler (also quicker, less complex, more straightforward, and more effective) than cookies.

  8. #8
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default

    if i pulled all your files in my database... and change server, db and log, pass, It will work?? Also i want to ask, if i need to create database, table and forms in phpmyadmin??
    I have to create as its written in your files?
    <i really like your system... i want to use it>

  9. #9
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    IMO, this is the best place to learn to use session:
    http://w3schools.com/php/php_sessions.asp

    If you give us the page codes [the registration, login, and pages that you want only registered users to access] we can show you where SESSION belongs.
    - Josh

  10. #10
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default

    i have just login yet... this is login and maybe you can help me with register also?

    PHP Code:
    <?php
    $host 
    "server";
    $username "asasas";
    $password "tututu";
    $db_name "phpacademy";
    $tbl_name "members";

    mysql_connect($host$username$password) or die(mysql_error("can't connect"));
    mysql_select_db($db_name) or die(mysql_error()); 

    $myusername $_POST['myusername'];
    $mypassword $_POST['mypassword'];

    $sql "SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";
    $result mysql_query($sql);

    $count mysql_num_rows($result);

    if(
    $count==1) {
     
    session_register("myusername");
     
    session_register("mypassword");
     
    $message "Success!";
     }
     else {
      
    $message "Wrong Username or Password";
      }
    ?>
    <html>
    <head>
     <title>login</title>
    </head>
    <body>
    message:
    <?php echo $message?>
    </body>
    </html>
    and this is a page i want to protect...

    PHP Code:
    <html>
    <
    head>
    <
    title>Forum</title>

    <!---------------------------------------------------------------->
    <
    script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <link rel="stylesheet" type="text/css" href="drilldownmenu.css" />
    <script type="text/javascript" src="drilldownmenu.js">
    </script>
    <script type="text/javascript">
    var mymenu=new drilldownmenu({
        menuid: 'drillmenu1',
        breadcrumbid: 'drillcrumb',
        persist: {enable: true, overrideselectedul: true}
    })
    </script>
    <!---------------------------------------------------------------->

    </head>
    <body bgcolor="black" text='#000000' link='black' atext='#000000' vlink='black'>
    <table width='500px' height='40px'>
    <tr>
    <td>
    </td>
    </tr>
    </table>
    <table background="images/general.JPG" align='center' width='765px' height='440px' style='border-color':black;border-style:solid;borderw-width:0px border='0'>
    <tr>
    <td>
    <table align='left' width='200px' height='300px' style='border-color':black;border-style:solid;borderw-width:0px border='0'>
    <tr>
    <td>
    <table>
    <tr>
    <td>
    </td>
    </tr>
    </table>
    <table width='150px' height='200px' align='left'>
    <tr>
    <td>
    <!-----------------------MENU--------------------------------------->
    <div id="drillmenu1" class="drillmenu">
    <ul>
    <li><a href="">Minas Tirith</a></li>
    <li><a href="members.php">Guild members</a></li>
    <li><a href="forum.php">Forum</a></li>
    <li><a href="killlist.php">Kill list  [Pk]</a></li>
    <li><a href="#">Information</a>
      <ul>
      <li><a href="#">Empty...</a></li>
      <li><a href="#">Empty...</a></li>
      <li><a href="#">Empty...</a>
      </li>
      </ul>
    </li>
    <li><a href="#">Other guilds</a>
      <ul>
      <li><a href="enemies.php">Enemies</a></li>
      <li><a href="allies.php">Allies</a></li>
      </ul>
    </li>
    <li><a href="traitors.php">!!!TRAITORS!!!</a></li>
    <li><a href="#">Shop</a>
      <ul>
      <li><a href="buy.php">Buy</a></li>
      <li><a href="sell.php">Sell</a></li>
      <li><a href="rps.php">RPS shop</a>
        <ul>
        <li><a href="https://shop.playrohan.com/ItemMall/ItemMall.html">Item mall</a></li>
        <li><a href="https://shop.playrohan.com/Exchange/Exchange.html">Exchange</a></li>
        </ul>
      </li>
      </ul>
    </li>
    <li><a href="http://www.playrohan.com">Play Rohan</a></li>
    <li><a href="choosen.php">Choosen RooM</a></li>
    </ul>
    <br style="clear: left" />
    </div>
    <!-------------------------MENU------------------------------------->
    <br><br><br>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    <table align='right' width='500px' height='50px' style='border-color':black;border-style:solid;borderw-width:0px border='0'>
    <tr>
    <td>
    <p><font size="5" color='#ECE5B6' face="Old English Text MT"><b>Minas Tirith guild site</b></font></p><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
    </td>
    </tr>
    </table>
    <!-------------------------langas------------------------------------->
    <table background="images/members.jpg" align='right' width='500px' height='360px' style='border-color':black;border-style:solid;borderw-width:0px border='1'>
    <tr align='center'>
    <td align='center'>
    <p><font size="2" color='black' face="Verdana"><b>Sorry... Can't connect</b></font></p><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
    </td>
    </tr>
    </table>
    <!-------------------------langas------------------------------------->
    </td>
    </tr>
    </table>
    <table align='center' width='500px' height='120px' style='border-color':black;border-style:solid;borderw-width:0px border='0'>
    <tr>
    <td align='center'>
    </td>
    </tr>
    </table>





    </body>
    </html> 
    thanks...
    Last edited by auriaks; 08-08-2009 at 12:13 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •