Ver Mensaje Individual
  #29 (permalink)  
Antiguo 14/10/2005, 12:35
coyote20
 
Fecha de Ingreso: febrero-2005
Mensajes: 867
Antigüedad: 19 años, 2 meses
Puntos: 3
computadora.php

<form action="computadoras.php" method="post">
<input type="text" name="busqueda" value="" style="font-size: 12px; border: 1px solid #000000" >
<input type="submit" value="Buscar" name="B1" style="font-size: 10px; border: 1px solid #000000">
</form>
<form action="colocar.php">
<input type="submit" value="Poner Anuncio" style="font-size: 10px; border: 1px solid #000000">
</form>
<table cellpadding="0" cellspacing="0" border="0" width="785" background="D:\Inetpub\wwwroot\bell ville\bell ville web/mainbg.gif" align="center">
<tr>
<td valign="top" align="center" width="650">
<div align="left">
<table cellpadding="0" cellspacing="0" width="650" border="0"></table>
<?php
$link = mysql_connect("localhost", "dominicana","clave");
mysql_select_db("formulario", $link);
$result = mysql_query("SELECT id_mensaje, titulo, precioventas, mensaje, sector, nombre, DATE_FORMAT(fecha, '%d-%M-%Y') as fecha
FROM mensaje, usuarios WHERE mensaje.id_usuario = usuarios.id_usuario ORDER BY fecha DESC ", $link);
echo "<table width='100%'> \n";
echo "<a href=index.php align=left><font size='2'>HOME</font> ";
echo "<td bgcolor = #ffcc99 align=center><font size='2'><b>Descripción<b></font></td> \n";
echo "<td bgcolor = #ffcc99 align=center><font size='2'><b>Ubicacion<b></font></td> \n";
echo "<td bgcolor = #ffcc99 align=center><font size='2'><b>Fecha<b></font></td> \n ";
echo "</tr> \n";
while($row=mysql_fetch_array($result)){
echo"<table width=650 border=0>";
//echo "<tr align=left valign=top bgcolor=#cccccc>";
echo "<table width=650 bgcolor=#cccccc>";
echo "<th width=200 align=left scope=col><span class=Estilo7>&nbsp;<span class=Estilo1>:.</span>&nbsp;</span></th>";
echo"<tr align=left valign=top bgcolor=#38A3C6>";
echo"<td bordercolor='#ffffff'><a href='paginainfo.php?id=" .$row["id_mensaje"]. "'><font size='4'>".$row["titulo"]."</td></td>";
echo"<td bordercolor='#ffffff' table width='40%' align=center><a href='paginainfo.php?id=" .$row["id_mensaje"]. "'><font size='3'>".$row["sector"]."</td></td>";
echo"<td bordercolor='#ffffff' align=center><a href='paginainfo.php?id=" .$row["id_mensaje"]. "'><font size='3'>".$row["fecha"]."</td></td>";
}
?>

aqui es donde hace la consulta para ver las cabeceras de todos los anuncios puesto de computadora esta es la parte donde no me sale porque el id_usuario y el identificador de la tabla mensaje llega en blanco

aqui le pongo esto por siacaso lo necesitan de los mensajes

paginainfo.php
<?php

$Host = "localhost";
$User = "dominicana";
$Password = "clave";
$Base = "formulario";
//$Tabla = "mensaje";

//conecta la base
$Link = mysql_connect ($Host, $User, $Password) or die("Error vp conexion ".mysql_error());
mysql_select_db($Base, $Link) or die("Error select db ".mysql_error());


//realiza la consulta
$Query = "SELECT * FROM mensaje WHERE id_mensaje='".$_GET['id_mensaje']."'";
$Result=mysql_query($Query, $Link) or die("error query $Query ". mysql_error());


while ($registro=mysql_fetch_array($Result))
{
echo "<table> \n";
echo "<tr> \n";
echo "<td>ID:</td> \n";
echo "<td>".$registro['id_mensaje']."</td>";
//echo "<td rowspan='4'><img src=\"./Productos/imagenes/".$registro['imagen']."\"></td>";
echo "</tr> \n";
echo "<td>Descripción:</td> \n";
echo "<td>".$registro['mensaje']."</td>";
echo "</tr> \n";
echo "<td>Precio</td> \n";
echo "<td>".$registro['precioventas']."</td>";
echo "</tr> \n";
echo "<td>Observación:</td> \n";
echo "<td>".$registro['titulo']."</td>";
echo "</tr> \n";
}
echo "</table>";

//cierra la base
mysql_close ($Link);

?>

--------------------------------------------------

aqui es el asunto en computadora.php tengo el boton que es para poner los mensaje

colocar.php

<form action="agregar.php" method="post"><B>Categoria de su Anuncio</b>
<select name="categorias">
<option value="0" >Elija una Categoria</option>
<option value="0101"
>Servicios Varios</option>
<option value="0201"
>Articulos del Hogar</option>
<option value="0301"
</select>
<table width="90%" border="0" cellspacing="2" cellpadding="2">
<input type="hidden" name="identificador" value="<?=$id?>">
<tr>
<td width="30%" align="right">Titulo </td>
<td><input type="text" name="titulo"></td>
</tr>
<tr>
<td width="30%" align="right">Precio de venta</td>
<td><input type="text" name="precioventas"></td>
</tr>
<tr>
<td width="30%" align="right">Mensaje</td>
<td><textarea name="mensaje" cols="50" rows="5"></textarea></td></tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="Submit" value="Enviar Mensaje"></td>
</tr>
</form>
</table>

----------------------------------

agregar.php

<?php
require('configuracionn.php');
$categorias = $_POST["categorias"];
$titulo = $_POST["titulo"];
$precioventas = $_POST["precioventas"];
$mensaje = $_POST["mensaje"];
$identificador = $_POST["identificador"];

//Hacemos algunas validaciones
if(empty($precioventas)) $precioventas = "Anónimo";
if(empty($titulo)) $titulo = "Sin título";
//Evitamos que el usuario ingrese HTML
$mensaje = htmlentities($mensaje);

// Grabamos el mensaje en la base.
$sql = "INSERT INTO mensaje (categorias, titulo, precioventas, mensaje, identificador, fecha, ult_respuesta) ";
$sql.= "VALUES ('$categorias','$titulo','$precioventas','$mensaje ','$identificador',NOW(),NOW())";
$rs = mysql_query($sql, $con) or die("Error al grabar un mensaje: ".mysql_error);
$ult_id = mysql_insert_id($con);
echo 'Registro exitoso. Su mensaje ah sido enviado!
<br>
<a href="computadoras.php?">anuncios</a>';

?>

en require('configuracionn.php'); es la conection a la BD

-------------------------------------------------------------------

ERROR
EN COLOCAR.PHP LA LINEA
<input type="hidden" name="identificador" value="<?=$id?>"> EL IDENTIFICADOR A LA BD LLEGA BACIO O EN BLANCO ( UNDEFINE ID) ENTONCES POR ESO ES QUE EN LA CONSULTA QUE HACE EN COMPUTADORA.PHP NO ME LO MUESTRA PORQUE ES CUANDO ME VERIFICA EL MENSAJE QUE PUSO EL USUARIO SI ME LLEGARA EL ID DEL USUARIO LIBREMENTE EN COMPUTADORA.PHP ME MOSTRARIA TODOS LOS ANUNCIOS

creo que algo mas detallado no podria darle ya :( otros medio vere si le subo la web a un hots con php o me envias tu correo y te mando la web en zip gracias de toda manera y su paciensia ........