shashilfs Posted April 10, 2007 Share Posted April 10, 2007 <?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 More sharing options...
trq Posted April 10, 2007 Share Posted April 10, 2007 whats wrong with this code?? Why don't you tell use what your expected outcome and actual outcome are?? Link to comment https://forums.phpfreaks.com/topic/46389-curl-help/#findComment-225617 Share on other sites More sharing options...
shashilfs Posted April 10, 2007 Author Share Posted April 10, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.