|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi! anybody got a sample PHP-script of user autherization, the login script or could help me with it?
I really preciate your help! thanks already. ------------------ -Aarno Villa |
|
#2
|
|||
|
|||
|
Its a bit of a mess but I hope it helps. It authenticates against a database I think, its been a while since I looked at authorisation stuff. You may need to change a few bits and pieces.
if(!isset($PHP_AUTH_USER)) { Header("WWW-authenticate: basic realm="$SID""); Header("HTTP/1.0 401 Unauthorized"); $title="Login Instructions"; echo "<blockquote> n". "You are not authorised to enter the siten". "</blockquote> n"; exit; } else { if ( $SID != "" ) $SID="@".ereg_replace("@","",$SID); if (!($conn=ora_logon("$PHP_AUTH_USER$SID",$PHP_AUTH_PW))) { //if (!($conn=ora_logon("$PHP_AUTH_USER",$PHP_AUTH_PW))) { Header("WWW-authenticate: basic realm="$SID""); Header("HTTP/1.0 401 Unauthorized"); $title="Login Instructions"; echo "<blockquote> n". "You are not authorised to enter the siten". "</blockquote> n"; exit; } } Falcon |
|
#3
|
|||
|
|||
|
Thanks Man! that helped much
I got another problem too, I have a filemanager made with PHP3 and it just doesn´t work right, maybe you could check it and try to fix (or someone else, maybe) it, I would appreciate that because I need it for my project, If you or someone else is interested of fixing it, I can mail it. let me know then ![]() Thanks already! |
|
#4
|
|||
|
|||
|
it would be fine if the script verifies the password against some password-file, because i can´t use databses such as Mysql
any solutions? |
|
#5
|
|||
|
|||
|
hehe I have a filemanager too ..
but it's missing some copy and move funktions I don't know a way to get the directory structure(on the fly) of my site =) so now its hidden deep in the basement |
|
#6
|
|||
|
|||
this is from ClipScripts, made by lacey pevey, and it just doesn´t work, file functions like Edit, Move and others,hopely somebody fixes it. I need that for one of my projects. |
|
#7
|
|||
|
|||
|
I fixed mine .. by using find.
If you are on a unix-box that does not run php in safe_mode it will work .. almost http://firewall.n3.net/download/efman099.zip |
|
#8
|
|||
|
|||
|
oki, but that download doesn´t work
maybe somebody delete that efman.zip before I downloaded it, damn. btw, how can I do a redirection after the user authetication, Header ("location: $url" ); doesn´t work, because it says that header is already set.any other ways to redirect it? |
|
#9
|
|||
|
|||
|
Code:
<?PHP Authorisation Header ?> <html> <head> <title></title> <?PHP if ($something) { echo "<meta http-equiv=refresh content=0; url=url_1.htm>"; } else { echo "<meta http-equiv=refresh content=0; url=url_2.htm>"; ?> </head> <body> </body> </html> I think this is right, I hope it helps. Falcon |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > PHP Development > Problem: User authorization with PHP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|