Jump to content

cURL Help


shashilfs

Recommended Posts

<?php

//ini_set('extension', 'php_curl.dll');

$regestration_number =    2222222;

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'http://cbseresults.nic.in/class12/cbse12.asp');

curl_setopt($ch, CURLOPT_HEADER, 0);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_POST, 1);

$postdata=array(

      "edit[regno]"=>$regestration_number

        );

curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);

$data = curl_exec($ch);

curl_close($ch);

echo $data;

?>

 

whats wrong with this code??

 

Regards,

SB

Link to comment
https://forums.phpfreaks.com/topic/46389-curl-help/
Share on other sites

I want to post data "roll no" to "http://cbseresults.nic.in/class12/cbse12.htm"  to get output "http://cbseresults.nic.in/class12/cbse12.asp"

but by this code i get access denied.

 

<?php

//ini_set('extension', 'php_curl.dll');

$regestration_number =    2222222;

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'http://cbseresults.nic.in/class12/cbse12.asp');

curl_setopt($ch, CURLOPT_HEADER, 0);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_POST, 1);

$postdata=array(

      "edit[regno]"=>$regestration_number

        );

curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);

$data = curl_exec($ch);

curl_close($ch);

echo $data;

?>

 

whats wrong with this code??

 

Regards,

SB

Link to comment
https://forums.phpfreaks.com/topic/46389-curl-help/#findComment-225622
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.