Tengo éste código:
Código PHP:
<?php
error_reporting(E_ALL);
header('Content-Type: text/html; charset=UTF-8');
require('includes/phpListGrab.class.php');
readfile('templates/header.html');
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
$phplistgrab = new phpListGrab($_POST['passport'], $_POST['password']);
$ret = $phplistgrab->grab();
if (!$ret)
{
switch ($phplistgrab->result)
{
case ERR_AUTHENTICATION_FAILED:
echo '<p>Contraseña incorrecta.</p>';
break;
case ERR_SERVER_UNAVAILABLE:
echo '<p>Problemas con el server.</p>';
break;
}
readfile('templates/footer.html');
exit();
}
$indent = str_repeat("\t", 3); // This is just to make the HTML pretty, the level of these elements is 3 tabs in.
echo "$indent<h3>Contacts</h3>\n\n$indent<ul>\n";
foreach ($phplistgrab->lists[LIST_FORWARD] as $contact)
{
echo "$indent\t".'<li><a href="http://members.msn.com/'.$contact['passport'].'">'.htmlentities($contact['friendlyname']).'</a></li>'."\n";
}
echo "$indent</ul>\n";
}
else
{
readfile('templates/form.html');
}
readfile('templates/footer.html');
?>
Saludos