-
fsockopen() non funziona
Salve a tutti. Ho scritto questo codice:
Codice PHP:
<html>
<head>
<title>Login OpenHack</title>
</head>
<body>
<form action="" method="post">
Nome utente: <input type="text" name="username"><br>
Password; <input type="password" name="password"><br>
Connessione Autonatica: <input type="checkbox" name="autologin" checked>
<input type="submit" value="invia">
</form>
<?php
if(isset($_POST['username'])) {
$sk = fsockopen("78.129.205.40",80,$errno,$errstr,60);
$br = "\r\n";
foreach($_POST as $k=>$v)
$vv .= "&".$k."=".rawurlencode(htmlentities($v));
$h = "POST /phpBB2/login.php HTTP/1.0".$br;
$h .= "Accept: image/gif, image/x-xbitmap, image/jpeg".$br;
$h .= "Accept-Language: it".$br;
$h .= "Host: http://openh4ck.altervista.org".$br;
$h .= "Connection: Keep-Alive".$br;
$h .= "User-Agent: terminale".$br;
$h .= "Content-Type: application/x-www-form-urlencoded".$br;
$h .= "Content-Length: ".strlen($vv).$br.$br;
fputs($sk, $h.$vv);
while(!feof($sk))
$d = fgets($sk, 2048);
echo $d;
fclose($sk);
}
?>
</body>
</html>
DOvrebbe eseguire il login ad un forum. Solo che ricevo questo errore:
Codice:
500 Can't connect to http://openh4ck.altervista.org:80 (Bad hostname 'http://openh4ck.altervista.org')
Non riesco a capire il perchè di questo errore
-
Non erano disabilitati i socket su AV?
-
cURL e fsockopen() si possono usare. Novità introdotta di recente. Ah mi ero scordato di dire che posso connettermi verso chiunque, ho mandato l'sms dal pannello
-
Ho provato anche io (ho mandato l'sms) e non funziona.
L'errore sta nel settaggio dell'host...
Invece di:
Codice PHP:
$h .= "Host: http://openh4ck.altervista.org".$br;
Prova ad inserire l'ip cioè:
Codice PHP:
$h .= "Host: 78.129.205.40".$br;
Ho provato e non da nessun errore