![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
08/06/2007, 13:03
|
![Avatar de ferbux](http://static.forosdelweb.com/customavatars/avatar180221_1.gif) | | | Fecha de Ingreso: mayo-2007 Ubicación: por ahí intentado ayudar
Mensajes: 823
Antigüedad: 17 años, 9 meses Puntos: 6 | |
Re: Problemas con la insercion en php Ah lo siento es ke copie mal el codigo pero lo vuelvo a postear.
Código:
<?
include("../../config.inc.php");
include_once("../../includes/cookies.inc.php");
include("../../includes/conexion.inc.php");
$link =Conec();
mysql_select_db("vatech", $link);
//Traer los datos de sala2.tpl
$pryestatus=$_POST['pryestatus'];
$emp=$_POST['emp'];
$fecha=$_POST['fecha'];
$moti=$_POST['moti'];
$reque=$_POST['reque[]'];
$per=$_POST['per'];
$de=$_POST['de'];
$a=$_POST['a'];
if( strtoupper( $_SERVER['HTTP_REQUEST_METHOD'] ) == "POST" ) {
// Insertas a tu base de datos
$ins = "INSERT INTO salax (id_sala, id_emp, fecha_soli, motivo, reque, tot_per, de, a)
VALUES ('$pryestatus','$emp','$fecha','$moti','$reque','$per','$de','$a')";
$res = mysql_query($ins) or die('Consulta fallida: ' . mysql_error());
if($res) { //Insercion o actulizacion exitosa,
mensaje al usuario.
echo "<script languaje=javascript>".
"alert(\"Sus datos han sido actualizados!\");".
//"location.href=\"InvDatos.php\";".
"</script>";
}
}
$smarty->display("salas2.tpl");
?>
|