Page 1 of 1

CURL is broken

Posted: Sun Oct 22, 2006 6:13 pm
by SidewinderX

Code: Select all

<?php
   $ch = curl_init();
   curl_setopt($ch, CURLOPT_URL, "https://www.novaworld.com/Players/Stats.aspx?id=33680801261&p=616065");
   curl_setopt($ch, CURLOPT_VERBOSE, 1);
   curl_setopt($ch, CURLOPT_POST, 0);
   curl_setopt($ch, CURLOPT_USERAGENT,  "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
   curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
   curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
   $returned = curl_exec($ch);
   curl_error($ch);
   curl_close($ch);
   echo $returned;
?>
I give up, CURL does not work with that URL on any of my 4 of my servers, all running different versions of php and different versions of curl and openssl. One of them even has the latest versions of curl and openssl with php 4.4.4

Im pretty sure my code is correct because it works with other secure sites such as https://www.google.com/adsense/. If i had money i'd pay someone to figure this out, but im broke, and I know someone in these forums knows whats wrong.

So dont be shy and post the answer :D

Posted: Sun Oct 22, 2006 6:21 pm
by John Cartwright
And the question/problem is.. *drum roll*







... we don't know yet!

Posted: Sun Oct 22, 2006 6:23 pm
by SidewinderX
The problem is the above code does not work and it should.

Posted: Sun Oct 22, 2006 6:29 pm
by John Cartwright
Help us help you, what are you getting back? Error messages? Have you considered using file_get_contents()?

Posted: Sun Oct 22, 2006 7:03 pm
by SidewinderX
Jcart wrote:Help us help you, what are you getting back? Error messages? Have you considered using file_get_contents()?
I appologize for my lousey posting, im just so fed up...



I get no error, no response.
Live example: http://www.extreme-hq.com/development/connect/curl.php

Yes I have concidered file_get_contents

Code: Select all

<?php
	$url = "https://www.novaworld.com/Players/Stats.aspx?id=33680801261&p=616065";
	$content = file_get_contents($url);
	echo $content;
?>
Live example: http://www.extreme-hq.com/development/connect/fgc.php (dosnt work either)


Odds are, if you test the script yourself, you will get the same problem.

Posted: Mon Oct 23, 2006 7:00 pm
by SidewinderX
Ive just tried this script on another server running php 5. I figured maybe it was something with 4.x as my test server is running 5.0.4 and it works fine. However it does not work.

Any other dieas? :roll:

Posted: Tue Oct 24, 2006 7:11 am
by printf
Maybe try it like this...

this will write any errors to the file called ./information.txt, change that name and path to where you want the file written! I also changed your SSL curl options, because you can't set verifypeer to false and then set verifyhost to true.

Code: Select all

<?php
   $ch = curl_init();
   curl_setopt($ch, CURLOPT_URL, "https://www.novaworld.com/Players/Stats.aspx?id=33680801261&p=616065");
   curl_setopt($ch, CURLOPT_VERBOSE, 1);
   curl_setopt($ch, CURLOPT_STDERR, './information.txt');
   curl_setopt($ch, CURLOPT_USERAGENT,  "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
   curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
   $returned = curl_exec($ch);
   curl_close($ch);
   echo $returned;
?>

pif!

Posted: Tue Oct 24, 2006 7:33 pm
by SidewinderX
thank you for the reply, but it still dosnt load nor generate a log, i just created that script in my root directory and removed the path to look like this

Code: Select all

<?php
   $ch = curl_init();
   curl_setopt($ch, CURLOPT_URL, "https://www.novaworld.com/Players/Stats.aspx?id=33680801261&p=616065");
   curl_setopt($ch, CURLOPT_VERBOSE, 1);
   curl_setopt($ch, CURLOPT_STDERR, 'information.txt');
   curl_setopt($ch, CURLOPT_USERAGENT,  "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
   curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
   $returned = curl_exec($ch);
   curl_close($ch);
   echo $returned;
?>
i suppose that would work


However, after numerous emails between me and my host we've concluded that the server is being blocked from connecting to novaworld.com for unknown reasons. When tested, we cant ping the server or wget the url. I suppose novaworld.com has aquired a large log of webservers and blocked them as even my new server (purchaced 3 days ago) does not work either, which i assume is why it works perfectly fine from my home server, but not any commercial server.

Now to find a proxy that I can use to connect :evil:

Im open to other suggestions also