asp.net - PHP Curl login into APSX page, after need to post data to Login page -


To begin, I'm sorry for my English, I'm not writing good in English and I have to go through There is no time to spell check. KKK

So, there is an overview of my problem. I was able to log in to ASPX pages with PHP cURL command, sending post data with all the crazy variables of Epix request. My problem is, to send post data (with user and password) on the login page, to send post data (with some crazy stuff) on the login page, in other words, to gain access to the page After that I want to, if I send some specified post data (with that crazy stuff) to the page, I only have access to the login page, if I do not send it, then I return to the main page I do not have login page.

I was able to order a curl on the login page with a crazy post and was getting access to the login page.

Have you not been redeeming people? Now, how can I send a post with a user / password on the login / page? If not, then I can try to understand more.

Thank you!

Rafael

If you want to give the user access to those pages Available after login - You have to save the cookie from the login page, and then send them every request. It can be done through curl.

Get the cookie:

  $ ch = curl_init (); Curl_setopt ($ ch, CURLOPT_URL, $ url); Curl_setopt ($ CH, CURLOPT_HEADER, true); Curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, true); Curl_setopt ($ CH, CURLOPT_USERAGENT, $ _SERVER ['HTTP_USER_AGENT']); $ Data = curl_xac ($ ch); $ Header = substart ($ data, 0, curl_getInfo ($ CH, CURLINFO_HEADER_SIZE)); $ Body = substr ($ data, curl_getinfo ($ ch, CURLINFO_HEADER_SIZE)); Preg_match_all ("/ set-cookie: (. *?) = (. *?); / I", $ header, $ res); $ Cookie = ''; Forex Currency ($ res [1] $ Key as in the form => $ value) {$ cookie. = $ Value '=' $ Res [2] [$ Key] '; '; }; Curl_close ($ ch);   

Return the cookie to any other curl request:

  curl_setopt ($ ch, CURLOPT_COOKIE, $ cookie);    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -