Ver Mensaje Individual
  #6 (permalink)  
Antiguo 09/06/2011, 06:14
mireley
 
Fecha de Ingreso: junio-2011
Mensajes: 5
Antigüedad: 12 años, 10 meses
Puntos: 0
Respuesta: Crear url corta para enviar por email

Gracias por la respuesta.
Me da un error en la linea 11

<?php
$url = 'http://to.ly/create.php';
$body = 'url=http://forosdelweb.com';
$c = curl_init($url);
curl_setopt($c, CURLOPT_POST, true);
curl_setopt($c, CURLOPT_POSTFIELDS, $body);
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
$page = curl_exec($c);
curl_close($c);
*
$doc = @DOMDocument::loadHTML($page);
$xpath = new DOMXPath($doc);
echo $xpath->query('//div[@style="margin-top: 20px;"]/a')
* * ->item(0)
* * ->firstChild
* * ->nodeValue;
* *
?>

Parse error: syntax error, unexpected T_VARIABLE in /home/tttt/public_html/urlcorta.php on line 11