login  Naam:   Wachtwoord: 
Registreer je!
 Forum

$errstr is success bij socket (Opgelost)

Offline Sander1993 - 09/01/2009 17:29 (laatste wijziging 09/01/2009 17:31)
Avatar van Sander1993PHP interesse ik was bezig met een socket uit te lezen,:
  1. $fp = fsockopen('http://guildwars.com',80,$errno,$errstr);
  2. if(!$fp) {
  3. print 'error: '.$errstr.' ('.$errno.')';
  4. } else {
  5. fwrite($fp, "GET / HTTP/1.1\r\nHOST: guildwars.com\r\n\r\n");
  6. while (!feof($fp)) {
  7. print fread($fp,256);
  8. }
  9. fclose ($fp);
  10. }

maar dan geeft hij deze error: Success (0)
hoe los ik dit op??

edit:
nu krijg ik Connection refused (111), maar waarom refused??

10 antwoorden

Gesponsorde links
Offline Wim - 09/01/2009 17:36
Avatar van Wim Crew algemeen $fp = fsockopen('http://guildwars.com',80,$errno,$errstr);

het protocol moet je volgens mij niet meegeven.

  1. $fp = fsockopen('www.guildwars.com',80,$errno,$errstr);
Offline Threetimes - 09/01/2009 17:37
Avatar van Threetimes PHP beginner Foutcodes van 0 betekenen vaak dat er geen fout is.
(Leest nu de PHP handleiding)
php.net/fsockopen schreef:
errno

If provided, holds the system level error number that occurred in the system-level connect() call.

If the value returned in errno is 0 and the function returned FALSE, it is an indication that the error occurred before the connect() call. This is most likely due to a problem initializing the socket.
Offline Sander1993 - 09/01/2009 17:39
Avatar van Sander1993 PHP interesse nu krijg ik deze
error: Connection refused (111)
hoe los ik dit op.
Offline Wim - 09/01/2009 18:06
Avatar van Wim Crew algemeen http://www.webh...p?t=566406

Google.be: Connection refused (111) fsockopen
Offline Sander1993 - 09/01/2009 18:15
Avatar van Sander1993 PHP interesse ik heb nu dit script maar t geeft dezelfde error :S
  1. <?php
  2. $curl = curl_init("www.guildwars.com");
  3. curl_setopt($curl,CURLOPT_HTTPGET,true);
  4. curl_exec($curl);
  5. if (curl_errno($curl))
  6. {
  7. print curl_error($curl);
  8. }
  9. else
  10. {
  11. curl_close($curl);
  12. }
  13. ?>
Offline Wim - 09/01/2009 18:30
Avatar van Wim Crew algemeen heb je het eerste topic uberhaupt wel gelezen?????

Citaat:
It is possible your web host is firewalling your external connections. Perhaps try connecting to google on port 80 or something just to verify that is not the issue.
Offline Sander1993 - 09/01/2009 19:13 (laatste wijziging 09/01/2009 19:23)
Avatar van Sander1993 PHP interesse ja, google werkt wel
Offline Koen - 09/01/2009 19:43
Avatar van Koen PHP expert Ik krijg:
  1. HTTP/1.1 301 Moved Permanently
  2. Age: 161
  3. Date: Fri, 09 Jan 2009 17:35:18 GMT
  4. Connection: Keep-Alive
  5. Via: NS-CACHE-6.0: 130
  6. ETag: "KXBICFAGJMTQSOOM"
  7. Location: http://www.guildwars.com/
  8. Keep-Alive: timeout=5, max=83
  9. Content-Type: text/html; charset=iso-8859-1
  10. Content-Length: 233
  11.  
  12. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
  13. <title>301 Moved Permanently</title>
  14. <h1>Moved Permanently</h1>
  15. <p>The document has moved <a href="http://www.guildwars.com/">here</a>.</p>
  16. </body></html>


"Connection Refused", guildwars weigert verbindingen van jouw server?
Offline Sander1993 - 09/01/2009 20:00 (laatste wijziging 09/01/2009 21:53)
Avatar van Sander1993 PHP interesse waarom juist mijn server? zou het aan mijn hoster liggen?

edit:
het ligt idd aan mn hoster; op een ander host krijg ik ipv een error dit:
Current Guild Wars News http://www.guil...efault.php http://blogs.law.harvard.edu/tech/rss Tue, 06 Jan 2009 11:44:42 GMT -0700 Thu, 08 Jan 2009 11:14:53 GMT -0700 RSSWriter 0.2.0.5 false general,community,competitive,press,update,events <b>Rebel Rising [rawr]</b> is back on top again, adding another GvG championship to their impressive tally after battling with <b>We Want Cookies [NOW]</b>. The Hero Battle tournament saw many top 100 players, and <b>Adorable Telly</b> fought through it all to defeat <b>Hadshi The Ranger</b> in the final round. Congratulations to all competitors! For more detailed rankings, you can find the full GvG and 1v1 results <a href="http://guildwars.com/competitive/tournament2008/zaishencalendar/">here</a>.<br/><br/> We will be adding December prediction points to the Xunlai Agent and updating the tonic in the Zaishen Chest today. If you made December predictions in the Xunlai Tournament House, check your neighborhood Xunlai Agent after the live update to claim your Tournament Reward Points.<br/><br/> To find out the tonic flavor for January, check the <a href="http://guildwars.com/competitive/tournament2008/zaishencalendar/">Zaishen Rewards Calendar</a>. http://guildwar...encalendar/ competitive {efjj-kgbu-fycb-lwxy) Thu, 08 Jan 2009 11:12:40 GMT -0700 Ever wanted to learn more about good game storytelling, straight from the source? The folks over at Joystiq put together a <a href="http://www.joystiq.com/tag/telling-stories">series of developer interviews focused on storytelling in games</a>, and among the luminaries weighing in is one of our own writers, Jeff Grubb. Get the professional storyteller's perspective on what works and what doesn't, what they love and what they try to avoid, and the importance of story vs. gameplay. http://www.joystiq.com/tag/telling-stories press {mpfi-ezlr-aczm-ycnj) Tue, 06 Jan 2009 11:44:00 GMT -0700 Once again, it's time to celebrate the season in true <i>Guild Wars</i> fashion! This year's annual <a href="http://guildwars.com/events/ingame/wintersday2008">Wintersday festival</a> is bigger and better than ever, with new NPCs, quests, rewards, and even holiday-themed PvP tournaments. You'll also get another chance at the best prizes and quests from previous Wintersday festivities, including the traditional snowball fight between the followers of Grenth and those of Dwayna. Plus, for the first time ever, you get to see the Eye of the North all decked out in its best holiday finery! <br/><br/> Clear your schedule from <b>December 19th</b> through <b>January 5th</b>, and make plans to join Lt. Thackeray of the Ebon Vanguard as he oversees and coordinates the most spectacular Wintersday festival ever! http://guildwars.com/events/ingame/wintersday2008 events {deic-sana-bmij-hmjp) Fri, 12 Dec 2008 11:17:01 GMT -0700 In November tournament news, September's champion, <b>Whats Going On [sup]</b>, emerged victorious over <b>Dangerous and Moving [DM]</b>. For Hero Battles, <b>I Smurf I</b> defeated <b>Dual Meld Tanker</b> to claim victory for November. We extend our congratulations to all competitors! You can find this month's skill usage charts, GvG results, and 1v1 results <a href="http://www.guildwars.com/competitive/tournament2008/november">here</a>. <br/><br/> Also, we are adding November prediction points to the Xunlai Agent and updating the tonic in the Zaishen Chest. If you made November predictions in the Xunlai Tournament House, check your neighborhood Xunlai Agent to claim your Tournament Reward Points.<br/><br/> To find out the tonic flavor for December, check the <a href="http://www.guildwars.com/competitive/tournament2008/zaishencalendar/">Zaishen Rewards Calendar</a>. http://www.guil...8/november competitive {tbly-tfyl-bose-ranp) Thu, 11 Dec 2008 13:52:05 GMT -0700 <a href="http://www.play-symphony.com/">"Play! A Video Game Symphony"</a> is returning to North America. Join special guest and <i>Guild Wars</i> composer Jeremy Soule at the Northern Alberta Jubilee Auditorium in Edmonton on January 9, 2009 to hear music from <i>Guild Wars</i> performed live by a full orchestra! http://www.play-symphony.com/ general {iydr-itsw-sfnl-yiji) Tue, 02 Dec 2008 13:22:16 GMT -0700
Offline Threetimes - 09/01/2009 21:58
Avatar van Threetimes PHP beginner andere host, dan maar...
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.219s