faqts : Computers : Programming : Languages : PHP : Common Problems

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

1 of 7 people (14%) answered Yes
Recently 1 of 7 people (14%) answered Yes

Entry

How do I pass a valid username password in a header thus bypassing the pop up box?

Dec 26th, 2005 06:38
Praveen Kumar Kukkapalli, Narendra Jain, Phil Mitchell,


You need to write some code in the file where you are checking the
authentication.
If($username && $password)
{
   validate();
}
else
{
   header();
}
Hope this helps.
By header, probably, you mean the URL bar at the top of the browser.
A definate NO-NO-NO situation for passwords to be passed in the header.
Very dangerous. User-Id, however, can always be passed in the header. 
One other way is to pass these values encrypted in the header, but that
makes the header look very big.
Best method is to use these variables defined a hidden varaibles and
pass it along with the form submit. 
Other way is to use session variables, which would internally authorize
the identity of the user.