.htaccess popup

This is a discussion on .htaccess popup within the Apache Web Server forums, part of the Web Server and Related Forums category; Hello all, I am using a PHP script to enter the Username and Password into the ..htaccess prompt without poping ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2004
Tiendegaard
 
Posts: n/a
Default .htaccess popup

Hello all,

I am using a PHP script to enter the Username and Password into the
..htaccess prompt without poping up the .htaccess panel from Apache. (see
script below)

If you enter the wrong Username and/or Password, the original login popup
will appear. What I would like to have is that you will be redirected to the
login screen and that you will see the message "Wrong Username and/or
Password"

Does anybody know how to modify this?

Thanks,
Dion

************************************************** ***********
<?php
$server = "www.tiendegaard.com/secure/users/start.html";

if(isset($HTTP_POST_VARS['username']))
{
$username = $HTTP_POST_VARS['username'];
}

if(isset($HTTP_POST_VARS['password']))
{
$password = $HTTP_POST_VARS['password'];
}

?>
<script>
function redirect()
{
window.location.replace("http://<?=$username?>:<?=$password?>@<?=$server?>")
;
}
setTimeout("redirect();", 1000);
</script>
************************************************** ***********


  #2 (permalink)  
Old 02-28-2004
Davide Bianchi
 
Posts: n/a
Default Re: .htaccess popup

Tiendegaard <thiemd1@hotmail.com> wrote:
> Does anybody know how to modify this?


I don't think it's possible, since it's the server that send out
to the browser the 'authorization request', while your script is
activated _before_ that is even requested.

Davide


--
| SHIFT TO THE LEFT! SHIFT TO THE RIGHT! POP UP, PUSH DOWN, BYTE, BYTE,
| BYTE!
|
|
  #3 (permalink)  
Old 02-28-2004
Mikki
 
Posts: n/a
Default Re: .htaccess popup

It is possible .

PHP should sent special headers and authorization windows will pop. After
you can get username and password within some variables and you can process
them (I don't know which headers, but you can search google for them).

But I preffer plain forms. Why do you want to use ayhorization popup?


"Davide Bianchi" <davideyeahsure@onlyforfun.net> wrote in message
news:c1pr3m$1lemt7$1@ID-18487.news.uni-berlin.de...
> Tiendegaard <thiemd1@hotmail.com> wrote:
> > Does anybody know how to modify this?

>
> I don't think it's possible, since it's the server that send out
> to the browser the 'authorization request', while your script is
> activated _before_ that is even requested.
>
> Davide
>
>
> --
> | SHIFT TO THE LEFT! SHIFT TO THE RIGHT! POP UP, PUSH DOWN, BYTE, BYTE,
> | BYTE!
> |
> |



  #4 (permalink)  
Old 03-01-2004
Richard Antony Burton
 
Posts: n/a
Default Re: .htaccess popup


"Tiendegaard" <thiemd1@hotmail.com> wrote in message
news:c1pq0a$fp6$1@news2.tilbu1.nb.home.nl...

>

window.location.replace("http://<?=$username?>:<?=$password?>@<?=$server?>")

That is an awful way to do this, not to mention the fact that it wont work
in Internet Explorer anymore. You might want to look at mod_auth_cookie
(http://modules.apache.org/search.php?id=3) for a better alternative.

If you wanted to make sure that you didn't get a popup, you could make sure
that the password is correct before you use it. If you used something like
mod_auth_msql you could use PHP and MySQL to check the password yourself
before you redirected your users. Other than that there isn't much you can
do, unless you want to remove Apache's own authentication, and replace it
with something done entirely in PHP.

Richard.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:36 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0