Home › Forums › Back End › To fetch the form results from an external website and displaying on my site
- This topic is empty.
-
AuthorPosts
-
January 29, 2014 at 1:55 am #161328
punithramesh007
Participanthi
i’m new to php but i tried to make my own edu website but i’m facing lot of problem bu using php
when the students enter their usn no(eg:1db12cs005) when user hit submit button it must fetch result from external website(eg:http://www.results.vtu.ac.in/) but I don’t want to redirected to the external website, where results can be seen. Instead, I want the results to be displayed on the same website. I’m open to to all kinds of suggestion!
i’m new to php so plz help me by giving complete codei got this from some website but it’s not working properly.when the student enter their usn no and when they hit submit button its just accessing their name but its not showing their marks and also it’s showing its result in sidebar i want to display in new windows(their r many website for eg fastvturesults.com,vtualerts they fetch from website http://www.results.vtu.ac.in/ )
<?phpecho '
‘;
if(isset($_POST[‘submit’])&&(!empty($_POST[‘rid’])))
{
$location = ‘http://results.vtu.ac.in/vitavi.php’;$userAgent = ‘Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)’;
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_URL, $location );$post_array = array(
“rid” => $_POST[‘rid’],
“submit” => “submit”
);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_array);
$response = curl_exec($ch);$start = ”;
$end = ”;$response = strstr($response, $start);
$end = stripos($response, $end);
$response = substr($response, strlen($start), $end – strlen($start));echo $response.””;
}?>
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.