Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- # Code By: Mudit Grover
- function get_string_between($string, $start, $end){
- $string = " ".$string;
- $ini = strpos($string,$start);
- if ($ini == 0) return "";
- $ini += strlen($start);
- $len = strpos($string,$end,$ini) - $ini;
- return substr($string,$ini,$len);
- }
- $raw = file_get_contents('roll.txt');
- $rawline = preg_split('/\r\n|\r|\n/', $raw);
- foreach($rawline as $rawlinedata){
- $url = 'http://cbseresults.nic.in/class12/cbse122015_all.asp';
- $myvars = 'regno=' . $rawlinedata;
- $ch = curl_init( $url );
- curl_setopt( $ch, CURLOPT_POST, 1);
- curl_setopt( $ch, CURLOPT_POSTFIELDS, $myvars);
- curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt( $ch, CURLOPT_HEADER, 0);
- curl_setopt($ch, CURLOPT_REFERER, 'http://cbseresults.nic.in/class12/cbse122015_all.htm');
- curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
- $response = curl_exec( $ch );
- echo $response;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement