Black-ID

Bac 2013 Mass Result

Jul 2nd, 2013
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.36 KB | None | 0 0
  1.  
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  5. <title>resultats bac 2013</title>
  6. <style type="text/css">
  7. body{width: 660px;margin:auto;margin-top:20px;margin-bottom:10px;}
  8. #majjbac {width:300px;font-Size : 20px;}
  9. #matriculebac {width:300px;font-Size : 48px;}
  10. </style>
  11. <script type="text/javascript">
  12. function entree(champs) {champs.style.backgroundColor='#AA0000';champs.style.color='#FFFFFF';champs.style.fontSize='48px'; }
  13. function sortie(champs){champs.style.backgroundColor='';champs.style.color='#777777';}
  14. </script>
  15.  
  16. </head>
  17. <body>
  18.  
  19. <div align="center" >
  20.  
  21. <div align="center"><form action="" method="post" name="formbac" id="formbac" onsubmit=""><input type="text" name="matriculebac" id="matriculebac"   value="" autocomplete="on" onclick="entree(this)" onfocus="entree(this)" onblur="sortie(this)" /><input type="text" name="matriculebac1" id="matriculebac"   value="" autocomplete="on" onclick="entree(this)" onfocus="entree(this)" onblur="sortie(this)" /><br /><br /><input type="submit" name="dobac" id="majjbac" value="Get" /></form><br />          
  22.  
  23. <?php
  24. if(isset($_POST['matriculebac'])) {
  25. $part1 = $_POST['matriculebac'];
  26. $part2 = $_POST['matriculebac1'];
  27. for ($part1; $part1 <= $part2; $part1++) {
  28. $file = fopen("res.html","a");
  29. $res = post($part1);
  30. echo $res;
  31. }
  32. }
  33. function post($code){
  34. $ch = curl_init();
  35. curl_setopt($ch, CURLOPT_URL, "http://ins.onec.dz/bac/index.php");
  36. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)");
  37. curl_setopt($ch, CURLOPT_POST, 1);
  38. curl_setopt($ch, CURLOPT_POSTFIELDS,"matriculebac=$code&dobac=%D8%A7%D8%B3%D8%AA%D8%B8%D9%87%D8%A7%D8%B1+%D8%A7%D9%84%D9%86%D8%AA%D9%8A%D8%AC%D8%A9");
  39. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  40. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  41. curl_setopt($ch, CURLOPT_COOKIEFILE, "/");
  42. curl_setopt($ch, CURLOPT_COOKIEJAR, "/");
  43. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  44. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  45. $result = curl_exec($ch);
  46. curl_close($ch);
  47. if(preg_match('/alert((.*));history.back()/', $result, $matches)){
  48. $mm = array('("','")');
  49. $result = str_replace($mm,"",$matches[1])."<br>----------------------------------------------------------<br>";
  50. $result = preg_replace("/\\\\n/", "<br />", $result);
  51. return $result;
  52. }
  53. }
  54. ?>
  55.  
  56. </div></body></html>
Advertisement
Add Comment
Please, Sign In to add comment