<?php
//ini_set("error_reporting",E_ALL);
function showerror()
{
die ("<B>Error</B> ".mysql_errno()." : ".mysql_error());
}
function goto($page, $id, $anch)
{
if ($anch=="1")
{
if($page=="work.php")
header("Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/$page?work=$id#ref");
if($page=="author.php")
header("Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/$page?auth=$id#works");
}
else
{
if($page=="work.php")
header("Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/$page?work=$id");
if($page=="author.php")
header("Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/$page?auth=$id");
}
}
function error($msg)
{
mysql_query("unlock tables");
echo "<B>",$msg,"</B>";
exit();
}
?>