I have a password protect web folder on my site, I am fetching that folder on another domain using Curl, what I want is: when I try to open the URL it should as
you can use cookies there I think. The steps would be:
If you try to curl "http://www.2nddomain.com/admin" with no cookies, it can return you a html login form.
Your form's action would point to 2nd server and if the credentials were right, set the cookie there and return (redirect) to server 1.
And if you curl again, you'd check the cookie on the other side and in this case, it could read that cookie and return you the admin page output instead.