Test For Fixing

Discussion in 'Spam Forum' started by Deacon Frost, Aug 14, 2008.

Test For Fixing
  1. Unread #1 - Aug 14, 2008 at 9:32 PM
  2. Deacon Frost
    Joined:
    Jan 30, 2007
    Posts:
    2,905
    Referrals:
    3
    Sythe Gold:
    57

    Deacon Frost Grand Master
    Banned

    Test For Fixing

    This is being used to figure out what caused the issue in the php coding...


    PHP:
    <?php require_once("maxProtector.class.php"); ?>
    ^^ not it.



    PHP:
    <?php
    /*************************************************
     * Max's Site Protector
     *
     * Version: 1.0
     * Date: 2007-11-27
     *
     ****************************************************/
    class maxProtector{
        var 
    $password 'test';
        
        function 
    showLoginForm(){
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
       <title>Max's File Uploader</title>
       <link href="style/style.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
           <div id="container">
                <div id="header"><div id="header_left"></div>
                <div id="header_main">Max's Site Protector</div><div id="header_right"></div></div>
                <div id="content">
                    <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
                         <center>
                             <label>Password:
                                 <input name="passwd" type="password" size="20" />
                             </label><br/>
                             <label>
                                 <input type="submit" name="submitBtn" class="sbtn" value="Login" />
                             </label>
                         </center>
                     </form>
                 </div>
                 <div id="footer"><a href="http://www.phpf1.com" target="_blank">Powered by PHP F1</a></div>
             </div>
    </body>         

    ^ not it


    PHP:
    <?php
        
    }

        function 
    login(){
            
    $loggedin = isset($_SESSION['loggedin']) ? $_SESSION['loggedin'] : false;
            if ( (!isset(
    $_POST['submitBtn'])) && (!($loggedin))){
                
    $_SESSION['loggedin'] = false;
                   
    $this->showLoginForm();
                   exit();
            } else if (isset(
    $_POST['submitBtn'])) {
                   
    $pass = isset($_POST['passwd']) ? $_POST['passwd'] : '';
          
                   if (
    $pass != $this->password) {
                       
    $_SESSION['loggedin'] = false;
                       
    $this->showLoginForm();
                       exit();     
                   } else {
                       
    $_SESSION['loggedin'] = true;
                   }
            }

        }
    }

    // Auto create
    session_start();
    $protector = new maxProtector();
    $protector->login();
    ?>

    <?php
    /*************************************************
    * Max's Site Protector
    *
    * Version: 1.0
    * Date: 2007-11-27
    *
    ****************************************************/
    class maxProtector{
    var $password = 'test';

    function showLoginForm(){
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Max's File Uploader</title>
    <link href="style/style.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="container">
    <div id="header"><div id="header_left"></div>
    <div id="header_main">Max's Site Protector</div><div id="header_right"></div></div>
    <div id="content">
    <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
    <center>
    <label>Password:
    <input name="passwd" type="password" size="20" />
    </label><br/>
    <label>
    <input type="submit" name="submitBtn" class="sbtn" value="Login" />
    </label>
    </center>
    </form>
    </div>
    <div id="footer"><a href="http://www.phpf1.com" target="_blank">Powered by PHP F1</a></div>
    </div>
    </body>
    <?php
    }

    function login(){
    $loggedin = isset($_SESSION['loggedin']) ? $_SESSION['loggedin'] : false;
    if ( (!isset($_POST['submitBtn'])) && (!($loggedin))){
    $_SESSION['loggedin'] = false;
    $this->showLoginForm();
    exit();
    } else if (isset($_POST['submitBtn'])) {
    $pass = isset($_POST['passwd']) ? $_POST['passwd'] : '';

    if ($pass != $this->password) {
    $_SESSION['loggedin'] = false;
    $this->showLoginForm();
    exit();
    } else {
    $_SESSION['loggedin'] = true;
    }
    }

    }
    }

    // Auto create
    session_start();
    $protector = new maxProtector();
    $protector->login();
    ?>

    <?php require_once("maxProtector.class.php"); ?>
     
  3. Unread #2 - Aug 14, 2008 at 9:33 PM
  4. HeavenLord
    Joined:
    Dec 16, 2007
    Posts:
    2,664
    Referrals:
    5
    Sythe Gold:
    0

    HeavenLord ujean
    Banned

    Test For Fixing

    omgwtflulzhaxwtfpwned.

    Frosty pwns teh nubs.
     
  5. Unread #3 - Aug 14, 2008 at 9:35 PM
  6. Deacon Frost
    Joined:
    Jan 30, 2007
    Posts:
    2,905
    Referrals:
    3
    Sythe Gold:
    57

    Deacon Frost Grand Master
    Banned

    Test For Fixing

    <?php
    /*************************************************
    * Max's Site Protector
    *
    * Version: 1.0
    * Date: 2007-11-27
    *
    ****************************************************/
    class maxProtector{
    var $password = 'test';

    function showLoginForm(){
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Max's File Uploader</title>
    <link href="style/style.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="container">
    <div id="header"><div id="header_left"></div>
    <div id="header_main">Max's Site Protector</div><div id="header_right"></div></div>
    <div id="content">
    <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
    <center>
    <label>Password:
    <input name="passwd" type="password" size="20" />
    </label><br/>
    <label>
    <input type="submit" name="submitBtn" class="sbtn" value="Login" />
    </label>
    </center>
    </form>
    </div>
    <div id="footer"><a href="http://www.phpf1.com" target="_blank">Powered by PHP F1</a></div>
    </div>
    </body>
    <?php
    }

    function login(){
    $loggedin = isset($_SESSION['loggedin']) ? $_SESSION['loggedin'] : false;
    if ( (!isset($_POST['submitBtn'])) && (!($loggedin))){
    $_SESSION['loggedin'] = false;
    $this->showLoginForm();
    exit();
    } else if (isset($_POST['submitBtn'])) {
    $pass = isset($_POST['passwd']) ? $_POST['passwd'] : '';

    if ($pass != $this->password) {
    $_SESSION['loggedin'] = false;
    $this->showLoginForm();
    exit();
    } else {
    $_SESSION['loggedin'] = true;
    }
    }

    }
    }

    // Auto create
    session_start();
    $protector = new maxProtector();
    $protector->login();
    ?>


    <?php require_once("maxProtector.class.php"); ?>
     
  7. Unread #4 - Aug 14, 2008 at 9:43 PM
  8. Deacon Frost
    Joined:
    Jan 30, 2007
    Posts:
    2,905
    Referrals:
    3
    Sythe Gold:
    57

    Deacon Frost Grand Master
    Banned

    Test For Fixing

    Lol... did it
     
  9. Unread #5 - Aug 14, 2008 at 9:44 PM
  10. HeavenLord
    Joined:
    Dec 16, 2007
    Posts:
    2,664
    Referrals:
    5
    Sythe Gold:
    0

    HeavenLord ujean
    Banned

    Test For Fixing

    Why? Cuz j00 pwn t3h nu8s?
     
  11. Unread #6 - Aug 14, 2008 at 9:55 PM
  12. Deacon Frost
    Joined:
    Jan 30, 2007
    Posts:
    2,905
    Referrals:
    3
    Sythe Gold:
    57

    Deacon Frost Grand Master
    Banned

    Test For Fixing

    This doesn't maintain, and it doesn't break like the other one.
     
  13. Unread #7 - Aug 14, 2008 at 10:19 PM
  14. cp
    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0

    cp an cat
    Banned

    Test For Fixing

    Code:
    <?PHP if (!isset($_SERVER['PHP_AUTH_USER']) && !isset ($_SERVER['PHP_AUTH_PW']))
    {
    header('WWW-Authenticate: Basic realm="Enter User Data!"');
    header('HTTP/1.0 401 Unauthorized');
    echo '<b>Authorization Required - Access Denied!</b>';
    // now unset user/name entered to retry
    unset($_SERVER['PHP_AUTH_USER']);
    unset($_SERVER['PHP_AUTH_PW']);
    exit;
    }
    else
    {
    // user is now auth
    echo 'Welcome ' . $_SERVER['PHP_AUTH_USER']. '<br />';
    echo $_SERVER['PHP_AUTH_PW'];
    } ?>
     
  15. Unread #8 - Aug 14, 2008 at 10:19 PM
  16. cp
    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0

    cp an cat
    Banned

    Test For Fixing

    Code:
    <?PHP if (!isset($_SERVER['PHP_AUTH_USER']) && !isset ($_SERVER['PHP_AUTH_PW']))
    {
    header('WWW-Authenticate: Basic realm="Enter User Data!"');
    header('HTTP/1.0 401 Unauthorized');
    echo '<b>Authorization Required - Access Denied!</b>';
    // now unset user/name entered to retry
    unset($_SERVER['PHP_AUTH_USER']);
    unset($_SERVER['PHP_AUTH_PW']);
    exit;
    }
    else
    {
    // user is now auth
    echo 'Welcome ' . $_SERVER['PHP_AUTH_USER']. '<br />';
    echo $_SERVER['PHP_AUTH_PW'];
    } ?>
     
< Test for fixing # 2 | Wtf >

Users viewing this thread
1 guest


 
 
Adblock breaks this site