PDA

View Full Version : LoadVars with PHP in a password protected directory



rmo518
May 21st, 2007, 12:40 PM
I'm using the sendAndLoad method to load some data from a PHP script. The problem is (at least seems to be) that the site is a testing folder that is password protected - it requests a user name and password before you can look at anything in the directory.

So sometimes the script fails because (or as I said, it seems to be because) it's not getting the user and name and password and so the request is denied.

First, does it sound like I have correctly diagnosed the problem?

Second, is there any way to send the username and password, perhaps using addRequestHeader? (I've taken a look at addRequestHeader but haven't been able to make much sense of it yet.)

Thanks for any insight you have on this.

rmo518
May 21st, 2007, 02:18 PM
Well I seem to have fixed the problem which was as follows:

The problem was occuring when the user used - mydomain.com/myfolder/
The sendAndLoad script was targeting an absolute URL www.mydomain.com/myfolder/myscript.php but the authentication for one doesn't cover the other. So the solution was to just use a relative link to myscript.php and the problem went away.

I am still curious - for the sake of testing the script from my desktop is there a way to pass the user name and password through AS (perhaps using addRequestHeader or the like)?