Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/06/2009, 13:32
Perrin_1
 
Fecha de Ingreso: marzo-2009
Mensajes: 163
Antigüedad: 15 años, 1 mes
Puntos: 0
problemas con formulario

alguien haber si me puede ayudar...tengo un simple formulario que guarda 4 campos y se conecta a una base de datos, pero tengo 2 problemas......1 no me esta guardando..les dejo el codigo de conexion

<?php
$dbhost="localhost";
$dbusuario="root";
$dbpassword="";
//$db="prueba";
$conexion = mysql_connect($dbhost, $dbusuario, $dbpassword);
//mysql_select_db($db, $conexion);
?>

y el 2do...tengo una seccion que debe de sacar consultas de los registros dados de alta pero al ingresar a la pagina me aparece en blanco! porque puede ser....les dejo el codigo de ese form.

<?php
include "conexion.php";

?>
<html>
<head><title>Consulta de Registro</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
<!--
body {
background-color: #CCFF66;
}
-->
</style></head>
<body>
<form id="form1" name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<p><strong>Consulta de Registros</strong></p>
<table width="811" border="0" cellspacing="0" cellpadding="0">
<tr>
<th width="63" scope="col">Campo:</th>
<th width="101" scope="col"><label>
<select name="campo" id="campo">
<option>Nombre</option>
<option>Apellido</option>
<option>Telefono</option>
<option>Email</option>
</select>
</label></th>
<th width="103" scope="col">Empiece con:</th>
<th width="144" scope="col"><label>
<input type="text" name="letra" id="letra" />
</label></th>
<th width="132" scope="col"><label>
<input type="submit" name="consultar" id="consultar" value="Consultar" />
</label></th>
<th width="139"><a href="index.htm">Regresar menu principal</a></th>
</tr>
</table>
</form>
</body>
<html>
<?php
if($_POST['submitted']!=false)
{
include"conexion.php";

$query = " Select * FROM datos where [selected_option] like "%[letra]%"";
$resultados = mysql_query($query,$db);
while($row = mysql_fetch_array($resultados))
{
echo '<br>'.$row["Nombre"].'-'.$row["Apellido"].'-'-$row["Telefono"].'-'.["Email"];
}


mysql_select_db($db, $conexion);



}
include "cerrar_conexion.php";
?>


gracias