supermerc Posted February 25, 2009 Share Posted February 25, 2009 Hey Ive tried countless things, I read up on cURL and im still not able to do what I wanted with cURL. Im logging in to a website / game call outwar using cURL, and I have no problem at that point, but the page i want to go to crew_vault.php is protected by a security word, so when you go to crew_vault.php it bring you to security_prompt.php to answer your security question, once you submit it brings you to crew_vault.php. For some reason it wont post the variables, which are prompt_number=12 answer=myanswer security_submitted=Continue <form method="post" action="security_prompt.php"> <input type="hidden" name="prompt_number" value="12" /> What is your favorite movie?<br> <input type="password" name="answer" value="" size="20" maxlength="30"> <br /> <input type="submit" value="Continue" name="security_submitted" /> </form> Now this is the code I currently have, what it does is simply brings me to security_prompt.php and does nothing for all i know. <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://quiver.outwar.com/myaccount.php'); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, 'login_username=username&login_password=pass'); curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt'); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, 'http://quiver.outwar.com/security_prompt.php?suid=55726&serverid=6'); $store = curl_exec ($ch); curl_setopt($ch, CURLOPT_URL, 'http://quiver.outwar.com/security_prompt.php'); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, 'prompt_number=12&answer=answer&security_submitted=Continue'); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); $result1 = curl_exec($ch); echo strip_tags($result1); curl_close ($ch); ?> If anyone could help me i've been messing around this for days! Quote Link to comment https://forums.phpfreaks.com/topic/146945-solved-curl/ Share on other sites More sharing options...
samshel Posted February 25, 2009 Share Posted February 25, 2009 as far as i know even if u do 2 curl_exec one after another they will not be as good as hitting one page after another. PHP is stateless.... you will have to try something like Snoopy class..it is a browser simulator , but i m not sure how elegantly it works !! Google for Snoopy.class.php Quote Link to comment https://forums.phpfreaks.com/topic/146945-solved-curl/#findComment-771443 Share on other sites More sharing options...
supermerc Posted February 25, 2009 Author Share Posted February 25, 2009 From what I understand I think I need to get it installed by my host and thats not an option, however I dont see why cURL couldnt do this job, if someone is experienced with curl and would like me to send them the info to the game so they can try for themselves please dont hesitate! Quote Link to comment https://forums.phpfreaks.com/topic/146945-solved-curl/#findComment-771452 Share on other sites More sharing options...
supermerc Posted February 25, 2009 Author Share Posted February 25, 2009 as far as i know even if u do 2 curl_exec one after another they will not be as good as hitting one page after another. PHP is stateless.... The reason why I put 2 one after the other is because the logging in brings you to your account where you can manage all your character, but to go on the site you must select a character, which is what im doing by adding suid=55726&serverid=6 ad the end of one of them. Quote Link to comment https://forums.phpfreaks.com/topic/146945-solved-curl/#findComment-771455 Share on other sites More sharing options...
samshel Posted February 26, 2009 Share Posted February 26, 2009 1) Firing 2 CURL requests back to back doesnt mean that it is hitting both pages one after another. It executes as if 2 differnet users are trying to open these pages in 2 different browsers. u need to login to open second page, so it will not work. 2) u dont need to isntall snoopy, u can just download and include it. it is a PHP class. Quote Link to comment https://forums.phpfreaks.com/topic/146945-solved-curl/#findComment-771470 Share on other sites More sharing options...
supermerc Posted February 26, 2009 Author Share Posted February 26, 2009 Well it is working because what it echos out it shows that its on that character. Quote Link to comment https://forums.phpfreaks.com/topic/146945-solved-curl/#findComment-771471 Share on other sites More sharing options...
samshel Posted February 26, 2009 Share Posted February 26, 2009 ow.......than i may be completely wrong ! sorry for mis-guiding u Quote Link to comment https://forums.phpfreaks.com/topic/146945-solved-curl/#findComment-771484 Share on other sites More sharing options...
supermerc Posted February 26, 2009 Author Share Posted February 26, 2009 bump Quote Link to comment https://forums.phpfreaks.com/topic/146945-solved-curl/#findComment-771521 Share on other sites More sharing options...
supermerc Posted February 26, 2009 Author Share Posted February 26, 2009 anyone? Quote Link to comment https://forums.phpfreaks.com/topic/146945-solved-curl/#findComment-771615 Share on other sites More sharing options...
supermerc Posted February 26, 2009 Author Share Posted February 26, 2009 hello Quote Link to comment https://forums.phpfreaks.com/topic/146945-solved-curl/#findComment-771945 Share on other sites More sharing options...
supermerc Posted February 26, 2009 Author Share Posted February 26, 2009 bump Quote Link to comment https://forums.phpfreaks.com/topic/146945-solved-curl/#findComment-772184 Share on other sites More sharing options...
supermerc Posted February 27, 2009 Author Share Posted February 27, 2009 bump Quote Link to comment https://forums.phpfreaks.com/topic/146945-solved-curl/#findComment-772513 Share on other sites More sharing options...
supermerc Posted February 27, 2009 Author Share Posted February 27, 2009 bump Quote Link to comment https://forums.phpfreaks.com/topic/146945-solved-curl/#findComment-772758 Share on other sites More sharing options...
premiso Posted February 27, 2009 Share Posted February 27, 2009 You know why this has gone unsolved? (Sorry I am just tired of it being bumped). A, we cannot login to that site to see what you are even talking about without being very proactive and creating an account (which I do not care to do). B, the security question, if it is an image and it is like a Captcha, you would need OCR technology to even begin to break that. C, If it is not, then essentially it should work, why it is not I really do not know as we cannot really view that site to see what is happening. Figured I would let you know why no one was responding. Quote Link to comment https://forums.phpfreaks.com/topic/146945-solved-curl/#findComment-772774 Share on other sites More sharing options...
supermerc Posted February 27, 2009 Author Share Posted February 27, 2009 A) I said If anyone wants to give an honest try at helping me Ill provide them with a login so they can try B) Now its not its a form, I posted the source. C) I dont know why it doesnt work, thats why Im asking for help here, I tried countless things. Quote Link to comment https://forums.phpfreaks.com/topic/146945-solved-curl/#findComment-772895 Share on other sites More sharing options...
premiso Posted February 27, 2009 Share Posted February 27, 2009 Ok then, so the issue is cURL is not posting the values for the security page and being redirected to the right page? Correct? If I am not mistaken, don't you have to re-put the curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt'); portion in for the second curl call or am I wrong? If you do not, and cURL does not carry that over, it would not know what/where the cookies. I could be wrong because I never used cURL extensively, but yea. That would be my suggestion from the code and just a logical knowledge of cURL. Quote Link to comment https://forums.phpfreaks.com/topic/146945-solved-curl/#findComment-772922 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.