<?php
include '../wap/guestbook/mylib.php';
include '../wap/config.php';
include 'acl.php';
if (!$uid) list ($uid, $pl) = priv_level();
$id=htmlspecialchars(trim($_GET['id']),ENT_QUOTES);
if (($conn=pg_connect("host=$dbhost port=$dbport dbname=$dbname user=$dbuser password=$dbpass"))) {
}
if ($id=='all') {
$res=pg_query($conn,"delete from messages where messages.to_u='$uid';");
} else {
$res=pg_query($conn,"delete from messages where messages.id='$id';");
}
pg_close($conn);
$link=sprintf("Location: messages.php");
header($link);
?>