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.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
  1. #1
    Junior Member
    Join Date
    Apr 2003
    Posts
    9
    Member #
    1124
    i'm trying to protect some pages with password...only 1 user and only 1 passwrod and also different ips can login....

    is this possible if so can someone help ???

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    It's not possible with any degree of security using an applet, HTML, Javascript, etc.

    Do you have any server-side languages on your host (other than SHTML)?
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Junior Member
    Join Date
    Apr 2003
    Posts
    9
    Member #
    1124
    yeah i got mysql cgi and php

  5. #4
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    In that case...
    /me moves thread to PHP forum
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  6. #5
    Junior Member
    Join Date
    Apr 2003
    Posts
    9
    Member #
    1124
    okay....u willin to help me then

  7. #6
    Junior Member Kriek's Avatar
    Join Date
    Mar 2003
    Location
    Florida
    Posts
    16
    Member #
    828
    Of course there are simpler methods, but none more or less secure IMO. Enjoy and feel free to ask any questions you have or any problems you may encounter.

    PHP Code:
    <?php
        ob_start
    ();
        if ((
    $PHP_AUTH_USER == 'admin') && ($PHP_AUTH_PW == 'password')) {
    ?>

    //page here

    <?php
        
    } else {
            
    header('WWW-Authenticate: Basic realm="Authorization Required!"');
            
    header('HTTP/1.0 401 Unauthorized');
            echo 
    'Authorization Required!';
        }
        
    ob_end_flush();
    ?>
    Everyone remain calm, I've done this before.

  8. #7
    Junior Member
    Join Date
    Apr 2003
    Location
    Ottawa, ON
    Posts
    21
    Member #
    1225
    I tried this code.

    and I got the following error.

    Notice: Undefined variable: PHP_AUTH_USER in xxxxxx\test.php on line 3

    Notice: Use of undefined constant admin - assumed 'admin' in xxxxxx\test.php on line 3
    Authorization Required!

    somethign with my php ? or...
    http://www.experimentalsadness.com
    http://www.emosucks.net

  9. #8
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Make sure you have a $ before the variable. Also try $_SERVER['PHP_AUTH_USER'].
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  10. #9
    Junior Member
    Join Date
    Apr 2003
    Location
    Ottawa, ON
    Posts
    21
    Member #
    1225
    thx, makign it with the $_

    works.
    http://www.experimentalsadness.com
    http://www.emosucks.net

  11. #10
    Member
    Join Date
    Mar 2003
    Posts
    61
    Member #
    782
    the problem was probably with "global vars" : off..


Page 1 of 2 1 2 LastLast

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:31 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com