Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question PHP Login Dialog. Pls Help.

    i use this codes for encrypte my pages. but at some machines it doesn't work...

    in username area adds automatically domain name :

    for example user name is : subat when i write user name it adds automacilly
    domainname.com/subat

    What Should i do?

    So Sorry for my poor english

    <?
    if (!isset($PHP_AUTH_USER)):
    header('WWW-Authenticate: Basic realm="Enter Admin Password"');
    header('HTTP/1.0 401 Unauthorized');
    exit;
    else:
    include "config.php";
    $result=mysql_query("Select * from us_table where uname= '$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'");

    if (mysql_affected_rows() !=1) :
    header('WWW-Authenticate: Basic realm="Enter Admin Password"');
    header('HTTP/1.0 401 Unauthorized');
    exit;
    else:
    $userid=mysql_result($result,0,'id');
    endif;
    endif;?>

  • #2
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,042
    Thanks
    19
    Thanked 42 Times in 42 Posts
    endif? whats that about and if (mysql_affected_rows() != 1) :
    you have the syntax all wrong i suggest reading some tutorials..

  • #3
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,517
    Thanks
    114
    Thanked 110 Times in 109 Posts
    this looks like a python script or something
    You can not say you know how to do something, until you can teach it to someone else.

  • #4
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    not wrong

    this is a php script.

    code has not error at : if (mysql_affected_rows() != 1)
    ( I take this script in php teaching book)

    tihs is right but my problem is not here... for example when i write tihs message i was at the office. in my computer that page wasnt work. but now i m at home and in this computer it works wonderful.

    some pc's adds auto domain name before user name.. this when done script does not work...

    Thanks..

  • #5
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,517
    Thanks
    114
    Thanked 110 Times in 109 Posts
    so does this if (): else endif; work on all versions of php?
    You can not say you know how to do something, until you can teach it to someone else.

  • #6
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,517
    Thanks
    114
    Thanked 110 Times in 109 Posts
    it works cool
    You can not say you know how to do something, until you can teach it to someone else.

  • #7
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    version

    dear timgolding;

    my problem is not in Server.. problems are in the clients.. some clients you can not login. adds auto domain name before the user name...

    Look page is here :

    http://www.13subat-dh.gov.tr/admin/

    if you entered a password ans press ok you will see yellow icon. this is normal. . but when you see again dialog page its not normal...


  •  

    Posting Permissions

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