doa24uk Posted November 30, 2009 Share Posted November 30, 2009 Hi guys, Here's my script mysql_connect("localhost", "REMOVED", "REMOVED") or die(mysql_error()); mysql_select_db("REMOVED") or die(mysql_error()); // Get all Links $result = mysql_query("SELECT * FROM ping") or die(mysql_error()); while($row = mysql_fetch_array( $result )) { // Send Pings now $title = $row['title']; $url = $row['url']; $offsiteurl = "http://offsitedomain.com/ping/?title=".$title."&blogurl=".$url."&chk_weblogscom=on"; echo $pingomatic; $handle = fopen($offsiteurl, "r") or die("Can't open file"); fclose($handle); It outputs the correct URL and then error's saying Can't open file ... It also says "HTTP wrapper does not support writeable connections" ... However if I hard code the URL into the fopen eg. fopen("http://google.com", "r") it works perfectly ??? All I want to do is create a bunch of URLs from my database & open them one at a time - surely it's simple stuff!!! Link to comment https://forums.phpfreaks.com/topic/183444-fopen-with-variable-not-working-hardcoded-does-work/ Share on other sites More sharing options...
mrMarcus Posted November 30, 2009 Share Posted November 30, 2009 echo $offsiteurl and compare it to your "hard-coded" copy. see if there are any discrepancies. Link to comment https://forums.phpfreaks.com/topic/183444-fopen-with-variable-not-working-hardcoded-does-work/#findComment-968308 Share on other sites More sharing options...
doa24uk Posted November 30, 2009 Author Share Posted November 30, 2009 I am so tired lol! I had spaces in the URLs. Replaced spaces with +s and everythings working fine now. Thanks DoA Link to comment https://forums.phpfreaks.com/topic/183444-fopen-with-variable-not-working-hardcoded-does-work/#findComment-968324 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.