I need to retrieve data from a webpage which need authentication. if I don’t login it will send restricted access responce. how can I login to that page with PHP and after that send my param’s to that page and retrieve data?
if I totally mistaking in my scenario what is the proper method for doing this?
I have to add this, the second page is a jsp page on another server.
Best Regards.
You could use curl.
At your php-script, which you used for your ajax request, you could open the login page. Than check which parameters does the login page needs and post the data to the login page with another curl request.
After that, you should be logged in and could retrieve the wanted data with another last curl request.
Make sure to setup the cookie usage, so the page can identify your request with the session.