...

View Full Version : PHP Login Dialog. Pls Help.



sonsukua
08-01-2007, 11:10 AM
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;?>

rafiki
08-01-2007, 01:54 PM
endif? whats that about and if (mysql_affected_rows() != 1) :
you have the syntax all wrong i suggest reading some tutorials..

timgolding
08-01-2007, 03:02 PM
this looks like a python script or something

sonsukua
08-01-2007, 05:07 PM
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..

timgolding
08-02-2007, 09:29 AM
so does this if (): else endif; work on all versions of php?

timgolding
08-02-2007, 09:49 AM
it works cool

sonsukua
08-02-2007, 08:24 PM
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...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum