Cita:
Iniciado por Sourcegeek Amigo, nosotros no ayudamos por email, para eso es el foro..
Segundo, si estas usando una aplicacion prefabricada, esta no es la seccion adecuada.
Tercero, si es una aplicacion tuya, deberias ponernos el codigo problematico...
No es prefabricada, he dicho que estoy haciendo un blog.
Pongo el código del index y luego el de la página de destino, aunque ya aviso que el de destino es un auténtico desaguisado porque no sé por dónde tirar:
Código PHP:
Ver original<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
</head>
<body>
<?php
function Conectarse()
{
{
echo "Error conectando a la base de datos.";
}
{
echo "Error seleccionando la base de datos.";
}
return $link;
}
$link=Conectarse();
/*echo "Conexión con la base de datos conseguida.<br>";*/
?>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<?php
$nombre=$_POST['nombre'];
$email=$_POST['email'];
$categori=$_POST['categori'];
{
mysql_query("INSERT INTO tabla(nombre,email,categori) VALUES('$nombre','$email','$categori')");
}
?>
<form id="form1" name="form1" method="post" action="" onclick="this.value=''">
<input name="categori" input type="hidden" type="text" id="categori" value="prueba" size="15">
<table cellpadding="0" cellspacing="0" width="607" height="178">
<!-- MSTableType="layout" -->
<tr>
<td valign="top" height="178" width="607">
<table width="607" border="1">
<tr>
<td width="160">Nombre</td>
<td width="431">
<input name="nombre" type="text" id="nombre" value="Tu nombre" size="20" onclick="this.value=''"/></td>
</tr>
<tr>
<td>texto</td>
<td><label>
<input name="email" type="text" id="email" size="96" />
</label></td>
</tr>
<tr>
<td width="160">Categor</td>
<td width="431">
</td>
</tr>
<tr>
<td height="23"> </td>
<td height="23">
<select name="prueba" onchange="javascript:document.form1.categori.value =(document.form1.prueba.value)">
<option value="Categoría">Categoría</option>
<option value='<a href="http://www.url.com/directorio/muñecas.php">muñecas</a>'>Muñecas</option>
<option value='<a href="http://www.url.com/directorio/ositos.php">ositos</a>'>Ositos</option>
<option value='<a href="http://www.url.com/directorio/juguetes.php">juguetes</a>'>Juguetes</option>
</select>
</td>
</tr>
<tr>
<td height="23"> </td>
<td height="23">
<p align="center"><input type="submit" value="Enviar" name="Enviar"></td>
</tr>
<tr>
<td height="23"> </td>
<td height="23">
</td>
</tr>
</table>
</form>
</tr>
</table>
<p> </p>
<table border="0" cellspacing=10 cellpadding=0 style="font-size: 8pt"><tr>
<td><font face="verdana"><b>Id</b></font></td>
<td><font face="verdana"><b>Nombre</b></font></td>
<td><font face="verdana"><b>texto</b></font></td>
<td><font face="verdana"><b>categori</b></font></td>
</tr>
<?php
or
die ("Error al conectar a la base de datos."); or
die ("Error al conectar a la base de datos.");
$query = "SELECT f.id, f.nombre, f.email, f.categori " .
"FROM tabla f " .
"WHERE f.email NOT IN ('Europa')";
$numero = 0;
{
echo "<tr><td width=\"25%\"><font face=\"verdana\">" .
$row["id"] . "</font></td>";
echo "<td width=\"25%\"><font face=\"verdana\">" .
$row["nombre"] . "</font></td>";
echo "<td width=\"25%\"><font face=\"verdana\">" .
$row["email"] . "</font></td>";
echo "<td width=\"25%\"><font face=\"verdana\">" .
$row["categori"] . "</font></td>";
}
?>
</table>
El de la página de destino:
Código PHP:
Ver original<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
</head>
<body>
<?php
function Conectarse()
{
{
echo "Error conectando a la base de datos.";
}
{
echo "Error seleccionando la base de datos.";
}
return $link;
}
$link=Conectarse();
/*echo "Conexión con la base de datos conseguida.<br>";*/
?>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<?php
$nombre=$_POST['nombre'];
$email=$_POST['email'];
$categori=$_POST['categori'];
{
mysql_query("INSERT INTO tabla(nombre,email,categori) VALUES('$nombre','$email','$categori')");
}
?>
<form id="form1" name="form1" method="post" action="" onclick="this.value=''">
<input name="categori" input type="hidden" type="text" id="categori" value="prueba" size="15">
<table cellpadding="0" cellspacing="0" width="607" height="178">
<!-- MSTableType="layout" -->
<tr>
<td valign="top" height="178" width="607">
<table width="607" border="1">
<tr>
<td width="160">Nombre</td>
<td width="431">
<input name="nombre" type="text" id="nombre" value="Tu nombre" size="20" onclick="this.value=''"/></td>
</tr>
<tr>
<td>texto</td>
<td><label>
<input name="email" type="text" id="email" size="96" />
</label></td>
</tr>
<tr>
<td width="160">Categor</td>
<td width="431">
</td>
</tr>
<tr>
<td height="23"> </td>
<td height="23">
<select name="prueba" onchange="javascript:document.form1.categori.value =(document.form1.prueba.value)">
<option value="Categoría">Categoría</option>
<option value='<a href="http://www.url.com/directorio/muñecas.php">muñecas</a>'>Muñecas</option>
<option value='<a href="http://www.url.com/directorio/ositos.php">ositos</a>'>Ositos</option>
<option value='<a href="http://www.url.com/directorio/juguetes.php">juguetes</a>'>Juguetes</option>
</select>
<a href="respuestas.php?ydlv=1<?php echo $row_tabla['id_tabla'];?>"><?php echo $row_tabla['nombre_tabla']; ?></a>
<a href="respuestas.php?ydlv=1<?php echo $row_tabla['id_tabla'];?>">
<input type="text" name="id" id="id" size="20"></a></td>
</td>
</tr>
<tr>
<td height="23"> </td>
<td height="23">
<p align="center"><input type="submit" value="Enviar" name="Enviar"></td>
</tr>
<tr>
<td height="23"> </td>
<td height="23">
</td>
</tr>
</table>
</form>
</tr>
</table>
<p> </p>
<table border="0" cellspacing=10 cellpadding=0 style="font-size: 8pt"><tr>
<td><font face="verdana"><b>Id</b></font></td>
<td><font face="verdana"><b>Nombre</b></font></td>
<td><font face="verdana"><b>texto</b></font></td>
<td><font face="verdana"><b>categori</b></font></td>
</tr>
<?php
or
die ("Error al conectar a la base de datos."); or
die ("Error al conectar a la base de datos.");
$query = "SELECT f.id, f.nombre, f.email, f.categori " .
"FROM tabla f " .
"ORDER BY id DESC";
"WHERE f.categori NOT IN ('awef')";
$result = mysql_query($query);("INSERT INTO tabla (id) values ('1')"); $numero = 0;
{
echo "<tr><td width=\"25%\"><font face=\"verdana\">" .
$row["id"] . "</font></td>";
echo "<td width=\"25%\"><font face=\"verdana\">" .
$row["nombre"] . "</font></td>";
echo "<td width=\"25%\"><font face=\"verdana\">" .
$row["email"] . "</font></td>";
echo "<td width=\"25%\"><font face=\"verdana\">" .
$row["categori"] . "</font></td>";
}
?>
</table>
No hay mucha diferencia entre uno y otro... En el de destino el formulario de entrada iría abajo, pero eso no importa ahora.