apr

get data problem

apr
Jun 22nd, 2014
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4. $postdata = http_build_query(
  5.     array(
  6.         'sr' => '0',
  7.         'exam' => 'jsc',
  8.         'year' => '2013',
  9.         'roll' => '401505',
  10.         'board' => 'dinajpur',
  11.         'button2' => 'submit'
  12.     )
  13. );
  14.  
  15. */
  16.  
  17.  
  18. //"sr=3&et=0&exam=jsc&year=2013&roll=401505&board=dinajpur&button2=submit"
  19. // post request will be -
  20. //http://www.educationboardresults.gov.bd/regular/result.php'
  21. //sr=3&et=0&exam=jsc&year=2013&board=dinajpur&roll=401505&button2=Submit&  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29. $url = "http://www.educationboardresults.gov.bd/regular/result.php";
  30. $postdata = http_build_query(
  31.     array(
  32.  
  33.         'sr'=>'3',
  34.         'et'=>'0',
  35.         'exam'=>'jsc',
  36.         'year'=>'2013',
  37.         'board'=>'dinajpur',
  38.         'roll'=>'401505',
  39.         'button2'=>'Submit'
  40.     )
  41. );
  42. $opts = array('http' =>
  43.     array(
  44.         'method'  => 'POST',
  45.         'header'  => 'Content-type: application/x-www-form-urlencoded',
  46.         'content' => $postdata
  47.     )
  48. );
  49. $context  = stream_context_create($opts);
  50. $result = file_get_contents($url, false, $context);
  51. echo $result;
Advertisement
Add Comment
Please, Sign In to add comment