[web]Pass Protect

Results 1 to 10 of 10
  1. #1
    Proficient Member BlackList is offline
    MemberRank
    Jan 2009 Join Date
    158Posts

    [web]Pass Protect

    I dont know if anyone wants this but say if you want to have seperate CP's for Admins GMs and players, you can pass word protect a page so Only GMs and such can access other 'certain features'.

    I dunno....I'm trying to learn php. C is to hard

    Code:
    <?php 
    
    // Define your username and password 
    $username = "someuser"; 
    $password = "somepassword"; 
    
    if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) { 
    
    ?> 
    
    <h1>Login</h1> 
    
    <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> 
        <p><label for="txtUsername">Username:</label> 
        <br /><input type="text" title="Enter your Username" name="txtUsername" /></p> 
    
        <p><label for="txtpassword">Password:</label> 
        <br /><input type="password" title="Enter your password" name="txtPassword" /></p> 
    
        <p><input type="submit" name="Submit" value="Login" /></p> 
    
    </form> 
    
    <?php 
    
    } 
    else { 
    
    ?> 
    
    <p>Insert text here. :P </p> 
    
    <?php 
    
    } 
    
    ?>


  2. #2
    Account Upgraded | Title Enabled! Xc3sz is offline
    MemberRank
    Nov 2008 Join Date
    Mostly at..Location
    260Posts

    Re: Pass Protect

    C is to hard
    how do u know lolz,haha..

    and nice,myb someone out there wants it :)

  3. #3
    Proficient Member BlackList is offline
    MemberRank
    Jan 2009 Join Date
    158Posts

    Re: Pass Protect

    I was looking at a tutorial (for begginers) and the first thing that came to mind was "wtf?"

  4. #4
    Account Upgraded | Title Enabled! HolySinX is offline
    MemberRank
    Sep 2008 Join Date
    LocalhostLocation
    787Posts

    Re: Pass Protect

    You could just use the auth function in XAMPP. [It's in the XAMPP directory. Htdocs -> Forbidden. You could just put the site you want to "protect" in that folder.]

  5. #5
    Proficient Member BlackList is offline
    MemberRank
    Jan 2009 Join Date
    158Posts

    Re: Pass Protect

    Quote Originally Posted by HolySinX View Post
    You could just use the auth function in XAMPP. [It's in the XAMPP directory. Htdocs -> Forbidden. You could just put the site you want to "protect" in that folder.]
    I dont like using XAMPP its seems to confusing...I prefer Wamp2

  6. #6
    [R8]ℓσℓ32 caja is offline
    MemberRank
    Oct 2008 Join Date
    Here!Location
    1,502Posts

    Re: [web]Pass Protect

    Jaja, good for begginers

    P.S: make a <form action ='index.php'> for go to another page when you press Login

  7. #7
    Alpha Member Masius is offline
    MemberRank
    Dec 2007 Join Date
    1,580Posts

    Re: [web]Pass Protect

    ..or you could make it so it would check the users accesslevel on the database and if it's higher than 800 the user can see the admin/GM panel, else he would get redirected somewhere else. ftw.
    good luck learning PHP

  8. #8
    [R8]ℓσℓ32 caja is offline
    MemberRank
    Oct 2008 Join Date
    Here!Location
    1,502Posts

    Re: [web]Pass Protect

    Quote Originally Posted by Sparkly View Post
    ..or you could make it so it would check the users accesslevel on the database and if it's higher than 800 the user can see the admin/GM panel, else he would get redirected somewhere else. ftw.
    good luck learning PHP
    lol
    This is not in the php begginer guide, wait until learn, and release more proyects.
    This, only allowe to enter with one user and pass.I think is usseles for now, we must wait for better one
    Good look learning php

  9. #9
    Account Upgraded | Title Enabled! Xc3sz is offline
    MemberRank
    Nov 2008 Join Date
    Mostly at..Location
    260Posts

    Re: [web]Pass Protect

    I was looking at a tutorial (for begginers) and the first thing that came to mind was "wtf?"
    Lolz,its quite easy,iam currently learning C++,first on my thought was,"wtf is the purpose of this guide,
    is it teaching me how to code in command promp only or is it only have cout << bla2.."

    but then i keep learning and on my thought i always said "C++ is easy" everytime even if its not,haha

    but i managed to find out the purpose of it when i was like in half of the books,its really help alot :)

    just keep on learning,eventually ull get to it,C++ is mostly like math lolz!!

  10. #10
    Infraction Banned bluepiexD is offline
    MemberRank
    Feb 2009 Join Date
    HellLocation
    819Posts

    Re: [web]Pass Protect

    Nice release! :D



Advertisement