Jump to content

secure authentication ??


sKunKbad

Recommended Posts

I am working on a website for a friend who wants to be able to have a secret message page for contributors. I found this script, which is working great, but I'm wondering if it is truly secure, and if not, how can I make it more solid.

[code]<?php
if ( ( !isset( $PHP_AUTH_USER )) || (!isset($PHP_AUTH_PW))
    || ( $PHP_AUTH_USER != 'Us3rn4M367' ) || ( $PHP_AUTH_PW != 'Tx56g$30o0' ) ) {

    header( 'WWW-Authenticate: Basic realm="Private"' );
    header( 'HTTP/1.0 401 Unauthorized' );
    echo 'Authorization Required.';
    exit;
}
?>
<html>
    <head>
    <title>Special Access Page</title>
    </head>
    <body>
    <h1>User Authenticated!</h1>
    <p>This is the message.</p>
    <p>Hello agents,<br/>
Please let the monkey feed itself. There are no room for dice in my bag.</p>
    </body>
</html>[/code]

Thanks for your help,
sKunKbad
Link to comment
https://forums.phpfreaks.com/topic/21627-secure-authentication/
Share on other sites

without the SSL, is this mostly secure?

I just looked in this guys hosting control panel, and SSL isn't an option. His host really bites if you ask me, but I wont name any names. I don't think he is going to want to pay for SSL. He's a bible smuggling missionary, so kinda on a low budget.
Link to comment
https://forums.phpfreaks.com/topic/21627-secure-authentication/#findComment-96509
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.