require("include/top.php");
unset($submitok);
// check the submitted data
if($web)
{
// check user account
if(!$_SESSION["SESSION"]||!$_SESSION["SCENEID"])
$errormessage[]="you need to be logged in first.";
// check if this party exists
$query = "SELECT count(0) FROM parties WHERE id=".$which;
$result = mysql_query($query);
if(!mysql_result($result,0))
$errormessage[] = "Lobster has eaten this party. Find it's dupe instead will yah? (\/) o_O (\/) *clack*";
// check if it already has web url..
$query = "SELECT web FROM parties WHERE id=".$which;
$result = mysql_query($query);
if(mysql_result($result,0))
$errormessage[] = "This party already has a webpage associated. Ask a pouet admin to change the url if thats what you were trying to do.";
// if everything is ok
if(!$errormessage)
$submitok=true;
}
if($submitok){
$query ="UPDATE parties SET web='".$web."' WHERE id=".$which;
mysql_query($query);
}
?>