<?php 
$page_title = 'welcome to this site! ';
include ('includes/header.html');

?><meta http-equiv="Content-Type" content="text/html; charset=utf-8">

 <script language="javascript">
   function check() {
   if(form2["city"].value =="")
{
alert("Enter city");
        form2["city"].style.border = "1px solid red";
		form2["city"].style.color = "red";
		form2["city"].style.visibility = "visible";
		valid = false;

return false;
}


  else
    return true;
     }


  </script>

<style type="text/css">
<!--
body {
	background-color: #C9E4E4;
}
body,td,th {
	color: #408080;
}
-->
</style><h1>City</h1>
<form method="POST" name="form2"   action="<?php echo( $self ); ?>" onSubmit="return check();" enctype="multipart/form-data">

<p>City:
	  <input name="city" type="text" size="20">
</p>
  <p>
    <input type="submit" name="Submit" value="Insert record">
  </p>
</form>
<?php
include('includes/footer.html');
?>



<?
include("connect.php");
if("Insert record"=="$Submit")
{

$sql="insert into city set city_name='$city'";
if(mysql_query($sql))
{
echo ("<script language='javascript'>window.alert('تم الحفظ بنجاح')</script>");
echo '<meta http-equiv="refresh" content="0;url=index.php">';

}
}

?>