Results 1 to 7 of 7

Thread: .htaccess passbox ...change look?

  1. #1
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default .htaccess passbox ...change look?

    About a year ago, I found a web site that used .htaccess to password protect folders and files. What was different about it though was the look of the passbox was different than normal.

    I emailed the site crator and asked how it was done. The response was an "I don't know, my php guy did it for me"

    I have looked again for the site to link to to show a live example, but I can't find it.

    Does anyone know how to go about changing the look of the passbox? I would like to change the words from username and password to something else, among other small things like that.

    Ideas?
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  2. #2
    Join Date
    Aug 2006
    Posts
    239
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    password box is user-agent idea, so unless that wasn't really GUI dialog (could be browser window disguised as one), no idea.

  3. #3
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    How do you know that it used .htaccess? It could have just been a regular login page(cleverly disguised). The .htaccess login works through HTTP authentication(I think) so I don't think you can do that. You could use PHP to read the .htaccess file and implement its own protection scheme.
    Last edited by blm126; 11-12-2006 at 11:24 PM. Reason: I have horrible spelling

  4. #4
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Well, I guess I don't "know" But when I viewed it in a non supported browser I got the plain jane .htaccess one.. dunno
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    The previous replies are quite correct. All modifying the .htaccess file causes is the 401 Unauthorized response code and the WWW-Authenticate header to be sent to the user agent, which then prompts for a password and responds with an appropriate Authorization header. The server has no control over the manner in which the user agent accomplishes this, other than altering the information contained in the WWW-Authenticate header (which usually contains information such as the name of the resource which can be displayed by the browser). It was likely a clever mockup, with a redirection to a standard 401 authentication-requiring resource if the browser didn't support some client-side script used.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    I have an idea. Since .htaccess/.htpasswd is based of off the 401 unauthorized response code, then you colud redirect to the resource from a custom login box.Look at the following URL
    Code:
    http://username:password@www.somepage.com
    Maybe you could build a custom login box, then use PHP to redirect. If you really wanted to get fancy you could parse the password file with PHP to give good error messages.

  7. #7
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Something to think about. Thanks all for the replies, I will look into it and let you know what I find out, if anything.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •