Ver Mensaje Individual
  #3 (permalink)  
Antiguo 26/10/2009, 07:08
javy
 
Fecha de Ingreso: septiembre-2002
Mensajes: 153
Antigüedad: 21 años, 8 meses
Puntos: 1
Respuesta: Por favor: necesito un ejemplo escrito

Tienes razón "ANESGY".

Aquí pongo el código de la segunda página:

<html>
<head>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<?php
//CONECTANDO CON LA BASE DE DATOS
require_once("../incluye/config_javy.php");
require_once("../incluye/funciones.php");
//CONECTAR A LA BASE DE DATOS
$cnx = conectar ();

//SI EL FORMULARIO HA SIDO ENVIADO, SE EDITA EL REGISTRO
if(isset($_POST['submit'])){

$sql = "INSERT INTO tipoimpresoras SET fabimpid ='".$_POST['fabimpid']."', numerocartuchoid ='".$_POST['numerocartuchoid']."', textotipoimp ='$textotipoimp', textopreciocartucho ='$textopreciocartucho'";


$res = mysql_query($sql) or die(mysql_error());
echo "Registro actualizado.<br><br><form action='tipoimpresoras.php' method='post'><input name='entrar' type='submit' id='entrar' value='REGRESAR' onClick='submit()' /></form>";
mysql_close($idcnx);
exit;
}



//CONECTANDO CON LA BASE DE DATOS
require_once("../incluye/config_javy.php");
require_once("../incluye/funciones.php");

//CONECTAR A LA BASE DE DATOS
$cnx = conectar ();
?>
<table border="1" cellpadding="0" cellspacing="0">
<form enctype="multipart/form-data" name="form1" method="post" action="<? echo $PHP_SELF;?>">
<tr>
<td colspan="2">
<?php
$fabimpid;
$numerocartuchoid;
mysql_select_db($DATABASE, $idcnx);
?>
<table>
<tr>
<td>Fabricante de Impresora:</td>
<?php
$cnx = conectar ();
$select = "SELECT DISTINCT numerocartuchoid, numerocartucho.fabimpid, textonumerocartucho, fabimpresoras.fabimpid, textofabimp";
$from = " FROM numerocartucho, fabimpresoras";
$where = " WHERE numerocartuchoid > 0 AND fabimpresoras.fabimpid = numerocartucho.fabimpid";
if ($fabimpid > 0) {
// HAY UN FABRICANTE DE IMPRESORAS
$where .= " AND fabimpresoras.fabimpid=$fabimpid";
}
if ($numerocartuchoid > 0) {
// HAY UN NÚMERO DE CARTUCHO
$where .= " AND numerocartuchoid=$numerocartuchoid";
}
$bus = mysql_query($select . $from . $where);
if( mysql_num_rows($bus) >0){
while ($bu = mysql_fetch_array($bus)){
$textofab = $bu["textofabimp"];
$textonumerocar = $bu["textonumerocartucho"];
?>
<td><input name="textofabimp" type="text" value="<?echo $textofab;?>" size="40">
<input type="hidden" name="fabimpid" value="<?echo $fabimpid;?>"></td>
<tr>
<tr>
<td>Número de Cartucho:</td>
<td><input name="textonumerocartucho" type="text" value="<?echo $textonumerocar;?>" size="40">
<input type="hidden" name="numerocartuchoid" value="<?echo $numerocartuchoid;?>"></td>
<?php
}// CIERRES DE LAS LINEAS 82 Y 83
}
?>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2"><table border="1" cellpadding="4" cellspacing="4">
<tr>
<td>Texto para el Nuevo MODELO DE IMPRESORA:</td>
</tr>
<tr>
<td><table cellpadding="2" cellspacing="2" bgcolor="#999999">
<tr align="center" valign="middle">
<td><img src="imagenes/negrita.gif" border="2" onClick="textotipoimp.value+='<B></B>'" onMouseOver="this.src='imagenes/negrita_sobre.gif'" onMouseOut="this.src='imagenes/negrita.gif'" /></td>
<td><img src="imagenes/cursiva.gif" width="21" height="20" border="2" onClick="textotipoimp.value+='<I></I>'" onMouseOver="this.src='imagenes/cursiva_sobre.gif'" onMouseOut="this.src='imagenes/cursiva.gif'" /></td>
<td><img src="imagenes/subrayar.gif" width="21" height="20" border="2" onClick="textotipoimp.value+='<U></U>'" onMouseOver="this.src='imagenes/subrayar_sobre.gif'" onMouseOut="this.src='imagenes/subrayar.gif'" /></td>
<td><img src="imagenes/izquierda.gif" width="21" height="20" border="2" onClick="textotipoimp.value+='<P align=left></P>'" onMouseOver="this.src='imagenes/izquierda_sobre.gif'" onMouseOut="this.src='imagenes/izquierda.gif'" /></td>
<td><img src="imagenes/centrar.gif" width="21" height="20" border="2" onClick="textotipoimp.value+='<P align=center></P>'" onMouseOver="this.src='imagenes/centrar_sobre.gif'" onMouseOut="this.src='imagenes/centrar.gif'" /></td>
<td><img src="imagenes/derecha.gif" width="21" height="20" border="2" onClick="textotipoimp.value+='<P align=right></P>'" onMouseOver="this.src='imagenes/derecha_sobre.gif'" onMouseOut="this.src='imagenes/derecha.gif'" /></td>
<td><img src="imagenes/justificar.gif" width="21" height="20" border="2" onClick="textotipoimp.value+='<P align=justify></P>'" onMouseOver="this.src='imagenes/justificar_sobre.gif'" onMouseOut="this.src='imagenes/justificar.gif'" /></td>
<td><select name="color_fuente" size="1" id="color_fuente" onChange="if(color_fuente.selectedIndex=='1')texto tipoimp.value+='<Font Color=#F8CC45></Font>'; if(color_fuente.selectedIndex=='2')textotipoimp.va lue+='<Font Color=#000000></Font>'; if(color_fuente.selectedIndex=='3')textotipoimp.va lue+='<Font Color=#CCCCCC></Font>'; if(color_fuente.selectedIndex=='4')textotipoimp.va lue+='<Font Color=#666666></Font>'; if(color_fuente.selectedIndex=='5')textotipoimp.va lue+='<Font Color=#FF0000></Font>'; if(color_fuente.selectedIndex=='6')textotipoimp.va lue+='<Font Color=#009900></Font>'; if(color_fuente.selectedIndex=='7')textotipoimp.va lue+='<Font Color=#003366></Font>'; if(color_fuente.selectedIndex=='8')textotipoimp.va lue+='<Font Color=#9F4000></Font>'; if(color_fuente.selectedIndex=='9')textotipoimp.va lue+='<Font Color=#FFFF66></Font>';">
<option>Seleccionar Color del Texto</option>
<option>Naranja</option>
<option>Negro</option>
<option>Gris Claro</option>
<option>Gris Oscuro</option>
<option>Rojo</option>
<option>Verde</option>
<option>Azul Oscuro</option>
<option>Marr&oacute;n</option>
<option>Amarillo</option>
</select></td>
<td><img src="imagenes/salto_linea.gif" width="21" height="20" border="2" onClick="textotipoimp.value+='<BR>'" onMouseOver="this.src='imagenes/salto_linea_sobre.gif'" onMouseOut="this.src='imagenes/salto_linea.gif'" /></td>
<td><img src="imagenes/insertar_barra.gif" width="21" height="20" border="2" onClick="textotipoimp.value+='<HR>'" onMouseOver="this.src='imagenes/insertar_barra_sobre.gif'" onMouseOut="this.src='imagenes/insertar_barra.gif'" /></td>
<td><img src="imagenes/insertar_imagen.gif" width="21" height="20" border="2" onClick="textotipoimp.value+='<IMG SRC=>'" onMouseOver="this.src='imagenes/insertar_imagen_sobre.gif'" onMouseOut="this.src='imagenes/insertar_imagen.gif'" /></td>
<td><img src="imagenes/link.gif" width="21" height="20" border="2" onClick="textotipoimp.value+='<A HREF=></A>'" onMouseOver="this.src='imagenes/link_sobre.gif'" onMouseOut="this.src='imagenes/link.gif'" /></td>
<td><img src="imagenes/arroba.gif" width="21" height="20" border="2" onClick="textotipoimp.value+='<A HREF=mailto:*@*.*></A>'" onMouseOver="this.src='imagenes/arroba_sobre.gif'" onMouseOut="this.src='imagenes/arroba.gif'" /></td>
<td><img src="imagenes/borrar.gif" width="21" height="20" border="2" onClick="textotipoimp.value=''" onMouseOver="this.src='imagenes/borrar_sobre.gif'" onMouseOut="this.src='imagenes/borrar.gif'" /></td>
<td><img src="imagenes/ayuda.gif" width="21" height="20" border="2" onClick="window.open('ayuda.php', 'v','scrollbars=1,width=650,height=500,top=5,left= 5');" onMouseOver="this.src='imagenes/ayuda_sobre.gif'" onMouseOut="this.src='imagenes/ayuda.gif'" /></td>
</tr>
</table></td>
</tr>
<tr>
<td><textarea name="textotipoimp" cols="100" rows="3" id="textotipoimp"></textarea></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2"><table border="1" cellpadding="4" cellspacing="4">
<tr>
<td>Introducir un Precio:<BR><BR><input name="textopreciocartucho" type="text" id="textopreciocartucho" value="0,00" size="20">
€<BR></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" name="submit" id="submit" value="enviar"></td>
</tr>
</form>
<form action="nuevo_tipoimp.php" method="post">
<tr>
<td colspan="2"><input type="submit" name="atras" value="<---"></td>
</tr>
</form>
<form action="tipoimpresoras.php" method="post">
<tr>
<td colspan="2" bgcolor="#CCCCCC"><input name="pag_principal" type="submit" value="<---"> Volver a MODELOS DE IMPRESORAS</td>
</tr>
</form>
</table>
</body>
</html>


Gracias por todo