se non hai ancora stampato nulla sulla pagina puoi modificare cosi:

codice:
$host_mysql         = "localhost";
   $utente_mysql     = "user";
   $password_mysql    = "pass";
   $database_mysql    = "web";
   
    $link             = mysql_connect($host_mysql,$utente_mysql,$password_mysql) or header("Location:paginadierrorre.php");}
    if (!$link) exit;
    else
    {$db_selected     = mysql_select_db("$database_mysql") or header("Location:paginadierrorre.php");}