Error fsockopen ()

1

I'm having an error on this line, and I do not know why, I tried everything and did not get results.

Error:

Warning: fsockopen () [function.fsockopen]: unable to connect to srvstm.com (Connection refused) in kick.php on line 39

<?php

$sql = mysql_query("SELECT * FROM dados_radio");

$ver = mysql_fetch_array($sql);

$kikar = $_POST['kikar'];

if($_POST){

    mysql_query("INSERT INTO logs_radio(usuario, ip, data) VALUES ('".$_SESSION['usuario_painel']."','".$_SERVER['REMOTE_ADDR']."','".time()."') ");

    $scfp = fsockopen($ver['ip'], $ver['porta'], &$errno, &$errstr, 10);

    if($scfp){

        fputs($scfp,"GET /admin.cgi?pass=".$ver['senha_kick']."&mode=kicksrc HTTP/1.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n");

        while(!feof($scfp)) {

            $page .= fgets($scfp, 1000);

        }

        fclose($scfp);

    }

    echo "<script>alert('Boa sorte. Processo feito com sucesso.')</script>";

}

?>
    
asked by anonymous 16.10.2015 / 23:47

1 answer

0

Have you used this function on this server and worked? It is likely that the allow_url_fopen directive is disabled on your server.

Place anywhere in your code and view the settings of your PHP and if the allow_url_fopen directive is enabled.

    
17.10.2015 / 00:44