RE: [PHP-ES] Nuevo en la Lista

From: Date: Fri, 13 Sep 2002 00:19:16 +0000
Subject: RE: [PHP-ES] Nuevo en la Lista
References: 1  Groups: php.general.es 
Request: Send a blank email to general-es+get-26895@lists.php.net to get a copy of this message
Hola listeros. Estuve corrigiendo los errores que me marcaron, pero sigo con problemas, a continuacion agrego todo el codigo fuente de mi programa. <html> <head> </head> <body> <?php $conn = pg_pconnect("user=pepe password=pepe1 dbname=pepe2 "); if (!$conn) { echo "Ocurrió un error al conectarse con la Base de Datos.\n"; exit;} if ($i==0) {$strsql = "insert into incidentes (inc_numero,inc_fecha,inc_nomabonado,inc_local,"; $strsql .= "inc_maquina,inc_problema,inc_fecie,inc_detasol,inc_matusado,inc_observ) values("; $strsql .= $incidente; if (!$winc_fecha) { $strsql .= ",''"; } else { $strsql .= ",'"; $strsql .=$winc_fecha; $strsql .= "'"; } if (!$winc_nomabonado) { $strsql .= ",''"; } else { $strsql .= ",'"; $strsql .=$winc_nomabonado; $strsql .= "'"; } if (!$winc_local) { $strsql .= ",''"; } else { $strsql .= ",'"; $strsql .=$winc_local; $strsql .= "'"; } if (!$winc_maquina) { $strsql .= ",''"; } else { $strsql .= ",'"; $strsql .=$winc_aquina; $strsql .= "'"; } if (!$winc_problema) { $strsql .= ",''"; } else { $strsql .= ",'"; $strsql .=$winc_problema; $strsql .= "'";} if (!$winc_fecie) { $strsql .= ",''"; } else { $strsql .= ",'"; $strsql .=$winc_fecie; $strsql .= "'"; } if (!$winc_solucion) { $strsql .= ",''"; } else { $strsql .= ",'"; $strsql .=$winc_solucion; $strsql .= "'"; } if (!$winc_material) { $strsql .= ",''"; } else { $strsql .= ",'"; $strsql .=$winc_material; $strsql .= "'"; } if (!$winc_observa) { $strsql .= ",'')"; } else { $strsql .= ",'"; $strsql .=$winc_observa; $strsql .= "')"; } } else {$strsql = "update incidentes set"; if ($winc_fecha) { $strsql .= " inc_fecha='"; $strsql .= $winc_fecha; $strsql .= "'"; } if ($winc_nomabonado) { $strsql .= ", inc_nomabonado='"; $strsql .= $winc_nomabonado; $strsql .= "'"; } if ($winc_local) { $strsql .= ", inc_local='"; $strsql .= $winc_local; $strsql .= "'"; } if ($winc_maquina) { $strsql .= ", inc_maquina='"; $strsql .= $winc_maquina; $strsql .= "'"; } if ($winc_problema) { $strsql .= ", inc_problema='"; $strsql .= $winc_problema; $strsql .= "'"; } if ($winc_fecie) { $strsql .= ", inc_fecie='"; $strsql .= $winc_fecie; $strsql .= "'"; } if ($winc_solucion) { $strsql .= ", inc_detasol='"; $strsql .= $winc_solucion; $strsql .= "'"; } if ($winc_material) { $strsql .= ", inc_matusado='"; $strsql .= $winc_material; $strsql .= "'"; } if ($winc_observa) { $strsql .= ", inc_observ='"; $strsql .= $winc_observa; $strsql .= "'"; } $strsql .= " where inc_numero="; $strsql .= $incidente; $strsql .= " "; } $result = pg_Exec($conn,$strsql); if (!$result) { echo "Error en la actualizacion de la Base de Datos.\n"; exit; } else { echo "<p align='center'>&nbsp;</p>"; echo "<p align='center'>&nbsp;</p>"; echo "<p align='center'><b><font face='Tahoma' color='#000080' size='4'>INCIDENTE MODIFICADO CORRECTAMENTE."; echo "</font></b></p>"; echo "<SCRIPT LANGUAGE='JavaScript'> "; echo "function on() { "; echo " window.history.back();"; echo "}"; echo " </SCRIPT>"; echo "<FORM method='POST' action='inicio.php3'>"; echo "<p align = 'center'><INPUT TYPE='SUBMIT' VALUE='Modificar Otro' style='font-family: Arial Black'></p>"; echo "</FORM>"; echo "<p>&nbsp;</p>"; } ?> </body> </html> El otro problema que tengo es que la variable $i es generada por el programa anterior, el cual tiene un formulario que permite el ingreso de los datos a grabar o actualizar, $i contiene los registros encontrados para un determinado incidente, si $i=0, es un alta, caso contrario es modificacion, la cuestion es que $i no existe en este programa, eso quiere decir que el metodo usado para pasar esa variable no me esta funcionando, este es el codigo del programa anterior donde paso las variables de un programa a otro. echo"<form NAME='index' onSubmit='return validarcampos()' ACTION='modifico.php3?incidente=".$incidente."?winc_fecha=".$r[1]."?winc_nom abonado=".$r[3]."?winc_local=".$r[4]."?winc_maquina=".$r[5]."?winc_problema= ".$r[6]."?winc_fecie=".$r[7]."?winc_solucion=".$r[8]."?winc_material=".$r[9] ."?winc_observa=".$r[10]."?i=".$i."' METHOD='POST' >"; Gracias por su ayuda. Julio Jacomo San Juan-Argentina

« previous php.general.es (#26895) next »