Sie sind auf Seite 1von 2

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.

or
g/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Agregar Docente</title>
<link href="Style/Add_Form.css" rel="stylesheet" type="text/css"
/>
</head>

<body bgcolor="#000000" background="Images/2head.jpg">


<div class="img"><img src="Images/auditoria.png" /></div>
<div class="ii"><center><img src="Images/Edit_Yes.png" style="margin-top:5px"/><
/center></div>
<div id="topbar">
<center><h1 style="color:#FFFFFF">Captura de Docentes</h1>
</div>
<table>
<form method="post" action="">
<tr>
<?php
include ("connect.php");
$g = mysql_query("select max(teaid) from tbl_teacher");
while($id=mysql_fetch_array($g))
{
?>
<th>ID:</th>
<td><input type="text" name="txtid" value="<?php echo $id[0]+1; ?>" readonly="re
adonly" /></td>
</tr>
<?php
}

?>
<tr>
<th>Nombre:</th>
<td><input type="text" name="txtname" placeholder="Type Name" /></td>
<th>Genero:</th>
<td><select name="txtgender">
<option>Selecciona el Genero</option>
<option>Masculino</option>
<option>Femenino</option>
</select>
</td>
</tr>
</table>
<?php
$id = $_POST['txtid'];
$name = trim($_POST['txtname']);
$gender = trim($_POST['txtgender']);
if(isset($_POST['cmdadd'])){
if(empty($name) )
{
echo "<center>Sorry please input data</center>";
}else{
include "connect.php";
$i = mysql_query("insert into tbl_teacher (teaid, name, gender) values('
".$id."','".$name."','".$gender."')");
if($i==true){
echo '<META HTTP-EQUIV="Refresh" Content="0; URL=index.php">';
}
//if($i==true){
//header('Location:index.php');
//exit;
//mysql_close();
//}
}
}

Das könnte Ihnen auch gefallen