The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> PHP Development
|
Problem: User authorization with PHP
Discuss Problem: User authorization with PHP in the PHP Development forum on Dev Shed. Problem: User authorization with PHP PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

January 5th, 2000, 02:46 AM
|
|
Junior Member
|
|
Join Date: Jan 2000
Location: Kouvola, Finland
Posts: 11
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
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
|

January 5th, 2000, 11:33 AM
|
|
Contributing User
|
|
Join Date: Nov 1999
Location: UK
Posts: 50
Time spent in forums: 2 h 21 m 33 sec
Reputation Power: 14
|
|
|
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
|

January 10th, 2000, 01:22 AM
|
|
Junior Member
|
|
Join Date: Jan 2000
Location: Kouvola, Finland
Posts: 11
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
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!
|

January 10th, 2000, 06:18 AM
|
|
Junior Member
|
|
Join Date: Jan 2000
Location: Kouvola, Finland
Posts: 11
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
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?
|

January 10th, 2000, 02:13 PM
|
|
Junior Member
|
|
Join Date: Dec 1999
Posts: 15
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
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
|

January 13th, 2000, 12:29 AM
|
|
Junior Member
|
|
Join Date: Jan 2000
Location: Kouvola, Finland
Posts: 11
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
 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.
|

January 14th, 2000, 12:55 PM
|
|
Junior Member
|
|
Join Date: Dec 1999
Posts: 15
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|

January 17th, 2000, 04:29 AM
|
|
Junior Member
|
|
Join Date: Jan 2000
Location: Kouvola, Finland
Posts: 11
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
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?
|

January 17th, 2000, 04:50 AM
|
|
Contributing User
|
|
Join Date: Nov 1999
Location: UK
Posts: 50
Time spent in forums: 2 h 21 m 33 sec
Reputation Power: 14
|
|
|
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
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|