esta es de admcliente.php
/**********************************************************************************************************************************************************/
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
</head>
<body>
<form id="form2" name="form2" method="post" action="accion_cliente.php">
<?php
include_once "conex.php";
$consulta ="select * from tb_clientes"; //consulta
$resultado= mysql_query($consulta);//ejecuto la consulta
?>
<script language="javascript">
function accion_agregar()
{
if (document.form2.textci.value != "")
{
document.form2.action="accion_cliente.php"
document.form2.quehacer.value="agregar"
document.form2,submit()
}
else
{
alert("dejastes un campo en blanco")
document.form2.textci.focus()
return;
}
return;
}
</script>
<table width="214" height="237" border="0">
<tr>
<td height="24"><div align="center">Agregar Cliente </div></td>
</tr>
<tr>
<td><table width="205" border="0">
<tr>
<td height="21"> </td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td>Cedula</td>
<td><input name="textci" type="text" id="textci" value="" /></td>
</tr>
<tr>
<td>Nombre</td>
<td><input name="textnombre" type="text" id="textnombre" /></td>
</tr>
<tr>
<td>Apellido</td>
<td><input name="textapellido" type="text" id="textapellido" /></td>
</tr>
<tr>
<td>Telefono</td>
<td><input name="texttlf" type="text" id="texttlf" /></td>
</tr>
<tr>
<td>Email</td>
<td><input name="textemail" type="text" id="textemail" /></td>
</tr>
</table>
<table width="208" border="0">
<tr>
<td><div align="center">
<input name="Submit" type="reset" value="Restablecer" />
</div></td>
<td><div align="center">
<input type="submit" name="Submit2" value="Agregar" onclick="accion_agregar()"/>
<input name="quehacer" type="hidden" id="quehacer" />
</div></td>
</tr>
</table> </td>
</tr>
</table>
</form>
</body>
</html>
esta de accion_cliente.php
/**********************************************************************************************************************************************/
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
</head>
<body>
<?php
include_once "conex.php";
if ($_POST[quehacer]=="agregar")
{
$consulta = " select * from tb_clientes where CI = '".$_POST[textci]."' ";
$resultado = mysql_query ($consulta);
$num_flias = mysql_num_rows($resultado);
if (!$num_filas)
{
$consulta = " insert into tb_clientes values ('', '".$_POST[textci]."', '".$_POST[textnombre]."',
'".$_POST[textapellido]."', '".$_POST[texttlf]."', '".$_POST[textemail]."' )";
$resultado= mysql_query($consulta);
}
else
{
?>
<script language="javascript">
alert("el dato ya existe intente con otro")
history.go(-1)
</script>
<?
}
}
?>
<script language="javascript">
alert("informacion procesada satifactoriamente");
location.href="admcliente.php";
</script>
</body>
</html>
/*********************************************************************************************************************************************/
les agradeceria mucho por su ayuda llevo 4 dias en esto y en realidad no se que pueda ser