run code in 200+ php & hhvm versions
Bugs & Features
<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.enigmagroup.org/missions/captcha/1/image.php"); curl_setopt($ch, CURLOPT_COOKIE, "mission=yes; enigmafiedV4=a%3A4%3A%7Bi%3A0%3Bs%3A5%3A%2287302%22%3Bi%3A1%3Bs%3A40%3A%222cba7b5b5618ee7e73fe97fdeee2da93f1004d17%22%3Bi%3A2%3Bi%3A1625913468%3Bi%3A3%3Bi%3A2%3B%7D; PHPSESSID=gmgqivglc7947mu31cijn592r0"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_REFERER, "http://www.enigmagroup.org/missions/captcha/1/"); // var stores the raw web-page data. (the web-page is only an image, no other HTML, so nothing to filter through) $var= curl_exec($ch); // creating an image from the raw data $imgRes = imagecreatefromstring($var); // Saving the image to the Tesseract Folder. imagepng($imgRes, 'C:\Tesseract-OCR\captcha.png'); // Tesseract is command line based, having it run the application, passing it the picture we want solved and telling it to store the output in captcha.txt exec('C:\Tesseract-OCR\tesseract.exe C:\Tesseract-OCR\captcha.png captcha.txt'); // Opening the output file generated by tesseract, if it opens, getting the output, storing it and printing it. @ $words = fopen("captcha.txt", rb); if ($words) { $line = fgets($words); echo $line; fclose($words); } // Forumulating output based on the Tesseract output & submitting it back to the page. $output = "answer=$line&submit=true"; curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $output); $var = curl_exec($ch); echo $var; // echoing page data so we can see if it was successful or not. ?>
based on qDU4i
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/j3uGJ:3 Stack trace: #0 {main} thrown in /in/j3uGJ on line 3
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Fatal error: Call to undefined function curl_init() in /in/j3uGJ on line 3
Process exited with code 255.