<?phpsession_start();include_once "../inc/db_connect.php";header('Content-Type: text/html;charset=utf8');$err = "";if(isset($_POST['regok'])){unset($_SESSION['reg_ok']);}if(!isset($_SESSION['user'])){	header("Location: index.php?");	exit();}else{	$data_user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `nick`='".$_SESSION['user']."'")) or die(mysql_error());	if($data_user['status'] == "Гонщик"){		header("Location: ../index.php?");		exit();	}else{?><?phpif($data_user['status'] == "Создатель"){if(isset($_POST['submit'])){	$car = mysql_real_escape_string($_POST['car']);	$carname = mysql_real_escape_string($_POST['carname']);	$speed = mysql_real_escape_string((int)$_POST['speed']);	$level = mysql_real_escape_string((int)$_POST['level']);	$price = mysql_real_escape_string((int)$_POST['price']); 	$price2 = mysql_real_escape_string((int)$_POST['price2']);	$id = mysql_real_escape_string((int)$_POST['id']);		$editcarsss = mysql_query("UPDATE auto SET `car`='$car',`carname`='$carname',`speed`='$speed',`price`='$price',`price2`='$price2',`level`='$level' WHERE id='".$id."'") or die(mysql_error());		if($editcarsss == true){			echo "<meta http-equiv='refresh' content='0; URL=index.php?cars' />";			exit();	}else{		echo "<meta http-equiv='refresh' content='0; URL=index.php?cars&editcar=".$id."' />";		exit();	}}else{	echo "<meta http-equiv='refresh' content='0; URL=index.php?cars' />";	exit();}}else{	echo "<meta http-equiv='refresh' content='0; URL=index.php?cars' />";	exit();}}}?>
