<?php
include ("config.php"); 
mysql_connect("$hhost","$login","$pass") or die ("Problem connecting to DataBase"); 
$query = "SELECT * FROM content  WHERE page = '$page'";
$result = mysql_db_query("$dbname", $query); 
$info = mysql_fetch_row($result);
if ($info){
$query = "update content  set 
page='$page',agggr='$agggr' where 
page='$page'";
$result = mysql_db_query("$dbname", $query); 
 
} else {
 
 $query = 'CREATE TABLE  IF NOT EXISTS content  ('
        . ' `page` VARCHAR(30), '
        . ' `agggr` LONGTEXT '
        . ' )';   
 $result = mysql_db_query("$dbname", $query);
$query = "insert into content values ('$page','$agggr')";
$result = mysql_db_query("$dbname", $query); 


echo "";
 
} 

header("Location: tabcont.php");
		exit;

?>