40) $end = 40; for($n = $start; $n <= $end; $n++) { //1-40 $speed = rand($minspeed, $maxspeed); $error = rand($minerror, $maxerror); $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, "http://school.typingpal.com/student/practice/" . $n . ""); curl_setopt($ch, CURLOPT_REFERER, "http://school.typingpal.com/student/practice/"); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13"); //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_COOKIE, $session); $data = curl_exec($ch); curl_close($ch); $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, "http://school.typingpal.com/student/practice/pratiqueflash/resultats.php?speed=" . $speed . "&errors=" . $error . "&nocache=0"); curl_setopt($ch, CURLOPT_REFERER, "http://school.typingpal.com/student/practice/" . $n); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13"); //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_COOKIE, $session); $data = curl_exec($ch); curl_close($ch); //echo $data; } } function doFinal($session) { $minspeed = rand(45, 47); $maxspeed = rand(60, 63); $minerror = rand(1,3); $maxerror = rand(9,16); $speed = rand($minspeed, $maxspeed); $error = rand($minerror, $maxerror); $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, "http://school.typingpal.com/student/tests/final"); curl_setopt($ch, CURLOPT_REFERER, "http://school.typingpal.com/student/"); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13"); //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_COOKIE, $session); $data = curl_exec($ch); curl_close($ch); $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, "http://school.typingpal.com/student/practice/pratiqueflash/resultats.php?speed=" . $speed . "&errors=" . $error . "&nocache=0"); curl_setopt($ch, CURLOPT_REFERER, "http://school.typingpal.com/student/tests/final"); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13"); //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_COOKIE, $session); $data = curl_exec($ch); curl_close($ch); //echo $data; } function stribet($inputstr, $delimiterLeft, $delimiterRight) { // Returns substring of $inputstr between $delimiterLeft and $delimiterRight $posLeft = stripos($inputstr, $delimiterLeft) + strlen($delimiterLeft); $posRight = stripos($inputstr, $delimiterRight, $posLeft); return substr($inputstr, $posLeft, $posRight - $posLeft); } function doExercises($session, $start, $end) { $id = ""; $cache = 0; $minspeed = rand(45, 47); $maxspeed = rand(60, 63); $minerror = rand(1,3); $maxerror = rand(9,16); if ($start = "" || $start <= 0) $start = 1; if ($end = "" || $end > 35) $end = 35; /* $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, "http://school.typingpal.com/index_ecole.asp?validate=1"); curl_setopt($ch, CURLOPT_REFERER, "http://school.typingpal.com/index_ecole.asp"); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13"); //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_COOKIEJAR, $session); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, "theCode=nsha"); $data = curl_exec($ch); //echo $data; $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, "http://school.typingpal.com/index_ecole.asp?menu=33"); curl_setopt($ch, CURLOPT_REFERER, "http://school.typingpal.com/index_ecole.asp"); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13"); //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_COOKIEJAR, $session); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, "sEcole=2062&username=&password="); $data = curl_exec($ch); curl_close($ch); $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, "http://school.typingpal.com/index_ecole.asp?validate=2"); curl_setopt($ch, CURLOPT_REFERER, "http://school.typingpal.com/index_ecole.asp"); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13"); //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_COOKIE, $session); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, "sEcole=2062&username=" . $username . "password=northshore"); $data = curl_exec($ch); $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, "http://school.typingpal.com/login/student"); curl_setopt($ch, CURLOPT_REFERER, "http://school.typingpal.com/index_ecole.asp"); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13"); //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_COOKIE, $session); $data = curl_exec($ch); echo $data; sleep(9000000000);*/ curl_close($ch); $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, "http://school.typingpal.com/student/exercises/exerciseurflash/getdata.php?noLeconDonnee=0"); curl_setopt($ch, CURLOPT_REFERER, "http://school.typingpal.com/"); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13"); //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_COOKIE, $session); $data = curl_exec($ch); curl_close($ch); $id = stribet($data, "&noUser=", "&"); for($n = $start; $n <= $end; $n++) { $speed = rand($minspeed, $maxspeed); $error = rand($minerror, $maxerror); $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, "http://school.typingpal.com/student/exercises/exerciseurflash/resultats.php?noLecon=" . $n . "&noUser=" . $id . "&stepSpeed=12&stepError=70&userSpeed=" . $speed . "&userError=" . $error . "¬eSpeed=100¬eError=4&stats=102+59+77+174-32+67+56+209-106+74+79+184&nocache=" . $cache); curl_setopt($ch, CURLOPT_REFERER, "http://school.typingpal.com/"); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13"); //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_COOKIE, $session); $data = curl_exec($ch); curl_close($ch); } } //javascript:document.location="http://google.com/?q=" + document.cookie; if ($_POST["session"] != "") { $session = $_POST["session"]; if ($_POST["doexercise"] == "True") doExercises($session, $_POST["startexer"], $_POST["endexer"]); if ($_POST["dopractice"] == "True") doPractice($session, $_POST["startprac"], $_POST["endprac"]); if ($_POST["dofinal"] == "True") doFinal($session); echo " Done..."; } else{ echo"fail"; } ?>