Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.