Cuando intento seguir el enlace...... recibo un error 102 ERR_CONNECTION_REFUSED
Alguna idea de como se soluciona? les paso el script pero para probarlo necesitarian datos de cuenta. Ojala me puedan ayudar!
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
Código PHP:
<?
// LOGUEO en RAVA
Include "pass.inc.php";
$form_url = "http://www.rava.com.ar/v2/clientes/posicion.php?";
$form_method = "POST";
// DATOS PERSONALES
$form_data['accion']="u_login";
$form_data['usuario_nivel_acceso']="cliente";
$form_data['u_usuario']=$user;
$form_data['u_clave']=$pass;
// Build the request data string
$request_data = "";
foreach ($form_data as $name=>$value)
{
if (strlen($request_data) > 0)
$request_data .= '&';
$request_data .= $name.'='.urlencode($value);
}
// Build the request
$url = parse_url($form_url);
$form_method = strtoupper($form_method);
$request = $form_method." ";
switch ($form_method)
{
case 'GET':
$request .= $url['path']."?".$request_data." HTTP/1.1\r\nHost: ".$url['host']."\r\n\r\n";
break;
case 'POST':
$request .= $url['path'] ." HTTP/1.1\r\nHost: ".$url['host']."\r\nContent-type: application/x-www-form-urlencoded\r\nContent-length: ".strlen($request_data)."\r\n\r\n".$request_data;
break;
default:die("Invalid method: ".$form_method);
}
$fp = fsockopen($url['host'], 80, $err_num, $err_msg, 30);
if ($fp)
{
fputs($fp, $request);
while (!feof($fp))
$response .= fgets($fp, 128);
$header_end=strpos($response,'<!DOCTYPE HTML PUBLIC');
$header=substr($response,0,$header_end);
$headers=explode('\n\r',$header);
for ($i=0;$i<sizeof($headers);$i++)
header($headers[$i]);
$response=substr($response,$header_end);
$response=str_replace('href="/','href="https://'.$url['host'].'/',$response);
$response=str_replace('src="/','src="https://'.$url['host'].'/',$response);
$response=str_replace('src=\"/','src=\"https://'.$url['host'].'/',$response);
$response=str_replace('background="/','background="https://'.$url['host'].'/',$response);
echo $response;
fclose($fp);
}
else
{
echo 'Could not connect to: '.htmlentities($url['host']).'<br />';
echo 'Error #'.$err_num.': '.$err_msg;
exit;
}
?>
Cita:
He intentado no cerrando el socket comentando la sentencia fclose($fp); pero sin resultados Error 102 (net::ERR_CONNECTION_REFUSED): Error desconocido