Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it
    Registrato dal
    Aug 2006
    Messaggi
    210

    i socket non mi funzionano

    Su windows ho installato wampserver2 ed ho provato fsockopen, ma mi dà questo errore:

    Warning: fsockopen() [function.fsockopen]: unable to connect to http://dizionari.corriere.it/diziona...ano/a.shtml:80 (Unable to find the socket transport "http" - did you forget to enable it when you configured PHP?) in C:\wamp\www\dizionario\scaricaDizionario.php on line 15
    Unable to find the socket transport "http" - did you forget to enable it when you configured PHP? (32)

    Ho provato col decommentare le righe relative ai socket in php.ini, ma l'errore viene fuori lo stesso. Potrei aver sbagliato la porta (80)? Grazie, raga.

  2. #2
    Utente di HTML.it
    Registrato dal
    Aug 2006
    Messaggi
    210
    questo è il codice

    $link='http://dizionari.corriere.it/dizionario_italiano/a.shtml';
    $fp = fsockopen ($link, 80, $errno, $errstr, 30);
    if (!$fp) {
    echo "$errstr ($errno)
    \n";
    } else {
    fputs ($fp, "GET / HTTP/1.0\r\nHost: $link\r\n\r\n");
    while (!feof($fp)) {
    echo fgets ($fp,128);
    }
    fclose ($fp);

    qlc mi aiuta? Grazie.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.