Ver Mensaje Individual
  #4 (permalink)  
Antiguo 10/09/2008, 11:39
mrdy7
 
Fecha de Ingreso: agosto-2008
Mensajes: 64
Antigüedad: 15 años, 8 meses
Puntos: 0
Respuesta: Guardar Datos en phpMyadmin

Lo arregle de la siguiente forma como me aconsejo y aun no me funciona.

<?php

$bd=mysql_connect("localhost","mrdy7","mi860810") or die("No se puede conectar a la Base de Datos");
mysql_select_db("envios");

$rep=$_GET["rep"];

if($rep==1)
{
$nombre=$_GET["categoria"];
$des=$_GET["descripcion"];

$sql="insert into categoria(nombre_cat,descripcion_cat) values ('".$nombre."','".$des."')";
$res=mysql_query($sql,$bd) or die (mysql_error());
}

?>
<html>
<head>
<script language="javascript">
function verifica()
{
if (document.fcat.categoria.value=="")
{
alert ("Por Favor Digite El Nombre De La Categoria");
return;
}
if (document.fcat.descripcion.value=="")
{
alert ("Por Favor Digite la Descripcion");
return;
}
fcat.rep=1;
fcat.submit();
}
</script>

<title> CATEGORIAS </title>

</head>

<body leftmargin="50" topmargin="50" marginwidth="50" marginheight="50">

<body bgcolor ="#958623">

<center> <font face ="Arial"> <font size ="7"> <font color ="#34gb74"> CATEGORIAS </font color> </font size> </font face> </center>

<body link="#112233" Vlink="#332211">

<br><br>

<form name="fcat">
<input type="hidden" name="rep">
<center> <table border=5 bordercolor="#74fv89" width="200">
<tr>
<td> <font color ="#74jh06"> NOMBRE CATEGORIA </font color> </td>
<td> <input type="text" name="categoria"> </td>
</tr>
<tr>
<td> <font color ="#74jh06"> DESCRIPCION </font color> </td>
<td> <textarea name="descripcion" > </textarea> </td>
</tr>
</table>
<input type="button" name="guardar" value="GUARDAR" onclick=verifica()>
</center>
</form>

</body>

</html>

No se que mas pueda tener mal. Gracias.