PHP - insertar a traves de un formulario con funciones

 
Vista:

insertar a traves de un formulario con funciones

Publicado por al (7 intervenciones) el 15/02/2006 17:39:46
tengo el siguiente problema tengo un formulario donde cada tecla va a ir a una funcion, realizo la primera y no resulta tengo el siguiente archivo c_costo.php, donde esta el formulario:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#000000" text="#FFFFFF">
<p align="center"><font size="5">INGRESO DE CENTRO DE COSTO</font> </p>
<p> </p>
<table width="100%" height="136" border="0" bgcolor="#000000">
<tr>
<td width="45%"><div align="right">CENTRO DE COSTO</div></td>
<td width="55%"><input type="text" name="TEXT_CCOSTO"></td>
</tr>
<tr>
<td><div align="right">AREA</div></td>
<td><input type="text" name="TEXT_AREA"></td>
</tr>
</table>

<form name="form2" method="POST" action="funciones_cc.php">
<div align="center">
<table width="67%" height="115" border="0" align="center">
<tr>
<td width="16%"><input name="accion_boton" type="submit" id="1" value="INSERTAR"></td>
<td width="17%"><input name="accion_boton" type="submit" id="2" value="MODIFICAR"></td>
<td width="22%"><input name="accion_boton" type="submit" id="3" value="SELECCIONAR"></td>
<td width="14%"><input name="accion_boton" type="submit" id="4" value="ELIMINAR"></td>
<td width="31%"><input name="accion_boton" type="submit" id="5" value="LISTAR"></td>
</tr>
</table>
</div>

<?php

$var_entrada = $_POST['accion_boton'];
include("CONEXION_BD.php");
Conectarse();

if ($var_entrada == 'INSERTAR'){
INGRESA_CCOSTO();
}
if ($var_entrada=='MODIFICAR'){
MODIFICAR_CC();
}
if ($var_entrada=='SELECCIONAR'){
SELECCIONAR_CC();
}
if ($var_entrada=='ELIMINAR'){
ELIMINAR_CC();
}
if ($var_entrada=='LISTAR'){
LISTAR_CC();
}

?>
</form>
<p align="center"> </p>
</body>
</html>


y me deberia ir a este archivo y ejecutar las funciones que esta contiene, pero no me funciona: el archivo es funciones_cc.php
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:insertar a traves de un formulario con funcione

Publicado por gonzalo (34 intervenciones) el 15/02/2006 21:20:42
hola a ver si te ayudo, lo estuve viendo y a mi me resulta, hace lo que digo mas abajo a ver si ese es el problema
<?php
<--------------------------
* // / SACA ESTO Y VE SI TE FUNCIONA,
$var_entrada = $_POST['accion_boton'];
VERIFICA SI EL VALOR LLEVA A ESTA PAGINA EJ: echo $accion_boton.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar