#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    3
    Rep Power
    0

    Exclamation pass form values to .htaccess


    I need to pass variables (user and password) to an htaccess login window so that i can give the password sign in area acustom html "wrapper"

    Can someone please suggest to me how to do this.

    If i should post this elswhere tell me that too,

    Thanks

    Bill
  2. #2
  3. mod_dev_shed
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    14,817
    Rep Power
    1099
    A little confused -- normal for me!

    Do you want to use HTTP Authentication, which is the grey box that pops up, and be able to use what the user enters in this box in a script?
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Location
    ol' Gay S.F.
    Posts
    95
    Rep Power
    13
    If you are using "basic authentication" then the credentials get sent in HTTP header variables...

    I can't confirm this, but I though that PHP could do an HTTP request passing custom variables. If this is true, then it might be possible to make a PHP that uses form variables to request a page... thus doing the login.

    Sorry I can't do more than theorize...
    TommyWillB
    Intel iMac 250GB external drive
    TommyWillB.com hosted on Mac OS X 10.4.x / Apache 1.3.x / PHP 4.x
  6. #4
  7. Rogue Sheep
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    Newark, DE (school) and Philadelphia, PA (home)
    Posts
    12
    Rep Power
    0
    It might just be easier to set up a simple database to hold usernames and passwords. You can encrypt the passwords to keep things safe, and it's quite easy to use this with an HTML form using something like PHP. Let me know if that helps.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    the syntax for http urls with authentication is:

    http://username:password@hostname.domain/path...

    in php you can thus use Header("Location: http://$username:$password@...");

    Possibly not all browsers do support this, do some tests yourself to make sure...
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    #1 From da_ronin
    I need to pass variables (user and password) to an htaccess login window so that i can give the password sign in area acustom html "wrapper"
    #2 From me
    Header("Location: http://$username:$password@...");
    #3 From TommyWillB
    The user can SEE these credentials, so they are not even "obscured"... much less "secured".
    Because this is a in a regular link, you'll soon see this showing up in Google and other search engines
    ...
    My advice... DON'T do this!
    Tommy, you are making a fool of yourself (#3)... Read first, think next, write then.

    First: Read quote #1: da_ronin wants to pass the credentials from a html form to the secured area, so the user does know the credentials already
    Second: google and other search engines donīt give a fvck about Header()s (#2), so this is false too.
    Third: since the user will be forwarded there by entering his credentials in a form, google would have to enter them too. It wonīt do that because search engines do not POST data nor do they know any valid username/password combo
    Last edited by M.Hirsch; March 15th, 2003 at 11:46 AM.
  12. #7
  13. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Location
    ol' Gay S.F.
    Posts
    95
    Rep Power
    13
    Fine... Pardon me to trying to help.

    Just say I'm wrong. I don't mind being wrong, but I do mind you being a jerk about it.

    I'm sure you are perfect and clearly an intellectual master mind. It seems you can not imagine a time when you might need my help...
    Last edited by TommyWillB; March 15th, 2003 at 02:56 PM.
    TommyWillB
    Intel iMac 250GB external drive
    TommyWillB.com hosted on Mac OS X 10.4.x / Apache 1.3.x / PHP 4.x

IMN logo majestic logo threadwatch logo seochat tools logo