Parece ser que hay duendes en algún sitio.
Hace un par de años le hice una página a un amiguete. Todo funcionando.
Hace un par de días, me pide que le añada un par de cosillas, y ahora han dejado de funcionar unas páginas para añadir texto a una base de datos.
El código es el siguiente: (la página se llama productos.php)
Cita:
Hasta ahora, siempre había funcionado... por lo menos, el amiguete no se quejó.<body>
<?php
if ($submit):
//CONECTANDO CON LA BASE DE DATOS
require_once("../incluye/config_x.php");
require_once("../incluye/funciones.php");
//CONECTAR A LA BASE DE DATOS
$cnx = conectar ();
$sql = "INSERT INTO productos SET textoproductos='$textoproductos'";
if (@mysql_query($sql)) {
echo "Registro actualizado.<br><br><form action='productos.php' method='post'><input name='entrar' type='submit' id='entrar' value='REGRESAR' onClick='submit()' /></form>";
} else {
echo("<p>Error : " .
mysql_error() . "</p>");
}
mysql_close($idcnx);
exit;
?>
<?php
else:
?>
<table border="1" cellpadding="0" cellspacing="0">
<form action="<?=$PHP_SELF?>" method="post">
<tr>
<td><textarea name="textoproductos" cols="100" rows="30" id="textoproductos"><? echo $fila['textoproductos'];?></textarea></td>
<td><input type="submit" name="submit" value="enviar"></td>
</tr>
</form>
<form action="inicio.php" method="post">
<tr>
<td><input name="entrar" type="submit" id="entrar" value="<---" onClick="submit()"></td>
</tr>
</form>
</table>
<?php endif; ?>
</body>
</html>
<?php
if ($submit):
//CONECTANDO CON LA BASE DE DATOS
require_once("../incluye/config_x.php");
require_once("../incluye/funciones.php");
//CONECTAR A LA BASE DE DATOS
$cnx = conectar ();
$sql = "INSERT INTO productos SET textoproductos='$textoproductos'";
if (@mysql_query($sql)) {
echo "Registro actualizado.<br><br><form action='productos.php' method='post'><input name='entrar' type='submit' id='entrar' value='REGRESAR' onClick='submit()' /></form>";
} else {
echo("<p>Error : " .
mysql_error() . "</p>");
}
mysql_close($idcnx);
exit;
?>
<?php
else:
?>
<table border="1" cellpadding="0" cellspacing="0">
<form action="<?=$PHP_SELF?>" method="post">
<tr>
<td><textarea name="textoproductos" cols="100" rows="30" id="textoproductos"><? echo $fila['textoproductos'];?></textarea></td>
<td><input type="submit" name="submit" value="enviar"></td>
</tr>
</form>
<form action="inicio.php" method="post">
<tr>
<td><input name="entrar" type="submit" id="entrar" value="<---" onClick="submit()"></td>
</tr>
</form>
</table>
<?php endif; ?>
</body>
</html>
¿Dónde está el fallo ahora?
Gracias a todos y un saludo:
Javy