Ver Mensaje Individual
  #4 (permalink)  
Antiguo 26/06/2014, 12:54
c_rubio_acevedo
 
Fecha de Ingreso: junio-2014
Mensajes: 14
Antigüedad: 9 años, 11 meses
Puntos: 0
Respuesta: al enviar formulario no me imprime valores en otra pagina

y acá la segunda pagina donde se hace el insert grabando datos en la tabla de la b.d lo que hace bien, pero no me muestra los datos en ls cajas de texto ingresados por usuario en la 1 pagina.

de ante mano, muchs gracias.

<?php require_once('Connections/conexiontribunal.php'); ?>


<?php

$rit_causa = $_POST['rit_causa'];
$fech_oficio= $_POST['fech_oficio'];
$funcionario= $_POST['funcionario'];
$destinatario_oficio= $_POST['destinatario_oficio'];
$ciudad= $_POST['ciudad'];
$estado_oficio= $_POST['estado_oficio'];



if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}


if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form_ofi")) {
$insertSQL = sprintf("INSERT INTO tbl_oficios (num_oficio, fech_oficio, funcionario, rit_causa, destinatario_oficio, ciudad, estado_oficio) VALUES (%s, %s, %s, %s, %s, %s, %s)",

GetSQLValueString($_POST['num_oficio'], "int"),
GetSQLValueString($_POST['fech_oficio'], "text"),
GetSQLValueString($_POST['funcionario'], "text"),
GetSQLValueString($_POST['rit_causa'], "int"),
GetSQLValueString($_POST['destinatario_oficio'], "text"),
GetSQLValueString($_POST['ciudad'], "text"),
GetSQLValueString($_POST['estado_oficio'], "text"));


echo num_oficio;

mysql_select_db($database_conexiontribunal, $conexiontribunal);
$Result1 = mysql_query($insertSQL, $conexiontribunal) or die(mysql_error());

$num_oficio = mysql_insert_id($conexiontribunal);





$insertGoTo = "oficio_crea_ok.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];

}
header(sprintf("Location: %s", $insertGoTo));

}

mysql_select_db($database_conexiontribunal, $conexiontribunal);
$query_Tabla_Oficio = "SELECT * FROM tbl_oficios";
$Tabla_Oficio = mysql_query($query_Tabla_Oficio, $conexiontribunal) or die(mysql_error());
$row_Tabla_Oficio = mysql_fetch_assoc($Tabla_Oficio);
$totalRows_Tabla_Oficio = mysql_num_rows($Tabla_Oficio);



?>




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/principal.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>SAIG.</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<style type="text/css">
.container .subcontenedor .content #form1 table tr td p strong {
font-size: 14px;
}
</style>
<!-- InstanceEndEditable -->
<link href="estilo/principal.css" rel="stylesheet" type="text/css" />
</head>

<body>

<div class="container">
<div class="header"></div>
<div class="subcontenedor">
<div class="sidebar1">
<?php include("includes/catalogo.php"); ?>
<!-- end .sidebar1 --></div>
<div class="content">
<h1><!-- InstanceBeginEditable name="titulo" -->Felicitaciones su &quot;oficio&quot; ha sido creado.<!-- InstanceEndEditable --></h1>
<!-- InstanceBeginEditable name="EditRegion4" -->
<p>Gracias...
</p>








<table align="center">

<tr valign="baseline">
<td width="94" align="left" nowrap="nowrap" bgcolor="#999999">N° OFICIO:</td>
<td width="224" bgcolor="#999999"><input type="text" name="num_oficio" value="<?php echo $num_oficio; ?>" readonly="readonly" size="15" />
</td>
</tr>



<tr valign="baseline">
<td width="94" align="left" nowrap="nowrap" bgcolor="#999999">Fecha:</td>
<td width="224" bgcolor="#999999"><input type="text" name="fech_oficio" value="<?php echo $fech_oficio; ?>" readonly="readonly" size="20" />
</td>
</tr>

<tr valign="baseline">
<td align="left" nowrap="nowrap" bgcolor="#999999">Autor:</td>
<td bgcolor="#999999"><input type="text" name="funcionario" value="<?php echo $nom_funcionario; ?>" readonly="readonly" size="32" />
</td>
</tr>

<tr valign="baseline">
<td align="left" nowrap="nowrap" bgcolor="#999999">Rit Causa:</td>
<td bgcolor="#999999"><input type="text" name="rit_causa" value="<?php echo $_POST['rit_causa']; ?>"/></td>
</tr>

<tr valign="baseline">
<td align="left" nowrap="nowrap" bgcolor="#999999">Destinatario:</td>
<td bgcolor="#999999"><input type="text" name="destinatario_oficio" value="<?php echo $destinatario_oficio; ?>"/></td>
</tr>

<tr valign="baseline">
<td align="left" nowrap="nowrap" bgcolor="#999999">Ciudad:</td>
<td bgcolor="#999999"><input type="text" name="ciudad" value="<?php echo $ciudad; ?>"/></td>
</tr>


<tr valign="baseline">
<td align="left" nowrap="nowrap" bgcolor="#999999">Estado:</td>
<td bgcolor="#999999"><input type="text" name="estado_oficio" value="<?php echo $estado_oficio; ?>"/></td>
</tr>

</table>

<p>&nbsp;</p>

<p>&nbsp;</p>
<p>&nbsp;</p>












<!-- InstanceEndEditable -->
<!-- end .content --><br><br><br><br><br></div>
<!-- end .subcontenedor -->

</div>

<div class="footer">
<p>Sitio de Administracion Interna de Gestion &quot;SAIG&quot; , Desarrollado por Cristan Rubio A.</p>
<!-- end .footer --></div>
<!-- end .container --></div>
</body>
<!-- InstanceEnd --></html>
<?php
mysql_free_result($Tabla_Oficio);
?>