Código HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Storm of Sighs</title> <link rel="shortcut icon" href="../objetos/favicon.ico" type="image/x-icon"> <link rel="stylesheet" href="estilo.css" type="text/css" media="all"> </head> <body> <div id="cabecera"><img src="objetos/cabecera.gif" alt="cabecera" height="200" width="900"></div> <?php $username = $_COOKIE['loggedin']; include("conexion.php"); ?> <script languaje="Javascript"> <!-- function Smile(texto){ document.form.mensaje.value = document.form.mensaje.value + texto; } // --> </script> <form method="post" name="form" action="enviar_privados2.php"> <input type=hidden name=de value=<? echo $username; ?>> <table align=center bgcolor=black width=350 cellspacing=1 cellpadding=3> <tr> <td bgcolor=#c4dBFB width="55"><font size="2"><b><font face="Verdana">De:</font></b></font></td> <td bgcolor=#e8edf2 width="268"><? echo "<font face=Tahoma size=2> <b>$username</b> - $REMOTE_ADDR"; ?></td> </tr> <tr> <td bgcolor=#E6EBFB width="55"><font face=Tahoma size=2><b>Para:</b></font></td> <td bgcolor=#e8edf2 width="268"> <select name="para"> <option selected disabled>-- Selecciona una usuario --</option> <? $result = mysql_query("SELECT * FROM ac_users ORDER BY username ASC"); while ($row = mysql_fetch_array($result)) { $para = $row['username']; ?> <option value= "<? echo $para ?>"><? echo $para; ?> </option> <? } ?> </select> </td> </tr> <tr> <td bgcolor=#c4dBFB width="55"><font face=Tahoma size=2><b>Titulo:</b></font></td> <td bgcolor=#e8edf2 width="268"> <input type=text name=asunto style="Font-size= 8pt; Font-Face=Tahoma" size="24" maxlength="255"> </td> </tr> <tr bgcolor="#E6EBFB"> <td colspan=2><font size=2 face=Tahoma> <center> <b>Mensaje:</b> </center> </font></td> </tr> <tr bgcolor="#e8edf2"> <td colspan=2> <center> <table width="70%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <textarea name=mensaje cols=42 rows=7 style="Font-size= 8pt; Font-Face=Tahoma"> </textarea> </td> </tr> </table> </center> <table width="70%" border="0" cellspacing="3" cellpadding="2" align="center"> <tr> <td> <div align="center"><a href="javascript:Smile('[:-m]')"><img src="ikon/1.gif" width="21" height="20" border="0" alt="Pensando"></a></div> </td> <td> <div align="center"><a href="javascript:Smile('[:)]')"><img src="ikon/2.gif" width="15" height="15" border="0" alt="Sonriendo"></a></div> </td> <td> <div align="center"><a href="javascript:Smile('[si]')"><img src="ikon/3.gif" width="28" height="28" border="0" alt="Arriba"></a></div> </td> <td> <div align="center"><a href="javascript:Smile('[no]')"><img src="ikon/4.gif" width="15" height="15" border="0" alt="Abajo"></a></div> </td> <td> <div align="center"><a href="javascript:Smile('[T_T]')"><img src="ikon/5.gif" width="40" height="15" border="0" alt="Llorando"></a></div> </td> <td> <div align="center"><a href="javascript:Smile('[o0o]')"><img src="ikon/11.gif" width="37" height="15" border="0" alt="Vete a freir espárragos"></a></div> <td> <div align="center"><a href="javascript:Smile('[:S]')"><img src="ikon/15.gif" width="15" height="15" alt="Decepcionado" border="0"></a></div> </td> </td> </tr> <tr> <td> <div align="center"><a href="javascript:Smile('[*o*]')"><img src="ikon/6.gif" width="29" height="15" border="0" alt="Eres mi diós"></a></div> </td> <td> <div align="center"><a href="javascript:Smile('[YY]')"><img src="ikon/7.gif" width="15" height="15" border="0" alt="Enfadado"></a></div> </td> <td> <div align="center"><a href="javascript:Smile('[adios]')"><img src="ikon/8.gif" width="25" height="15" border="0" alt="Adios"></a></div> </td> <td> <div align="center"><a href="javascript:Smile('[0.0]')"><img src="ikon/9.gif" width="15" height="30" border="0" alt="Sorprendido"></a></div> </td> <td> <div align="center"><a href="javascript:Smile('[=D]')"><img src="ikon/10.gif" width="25" height="15" border="0" alt="Carcajeando"></a></div> </td> <td> <div align="center"><a href="javascript:Smile('[yeah]')"><img src="ikon/12.gif" width="29" height="25" alt="Yeah" border="0"></a></div> </td> <td> <div align="center"><a href="javascript:Smile('[^^]')"><img src="ikon/13.gif" width="15" height="15" alt="sonrisita" border="0"></a></div> </td> <td> <div align="center"><a href="javascript:Smile('[:(]')"><img src="ikon/14.gif" width="15" height="17" alt="Triste" border="0"></a></div> </td> </tr> <tr> </tr> </table> </td> </tr> <tr bgcolor="#c4dBFB"> <td colspan="2"><font face=Tahoma size=2><b> <input type=submit value=Enviar style="Font-size= 8pt; Font-Face=Tahoma"> <input type=reset value=Borrar name="reset" style="Font-size= 8pt; Font-Face=Tahoma"> </b></font> </td> </tr> </table> </form> </body> </html>
Código:
CREATE TABLE `mensajes` ( `msgid` int(9) NOT NULL AUTO_INCREMENT, `de` char(255) NOT NULL, `para` char(255) NOT NULL, `asunto` char(255) NOT NULL, `mensaje` longtext NOT NULL, `fecha` char(255) NOT NULL, `leido` int(10) NOT NULL DEFAULT '0', PRIMARY KEY (`msgid`) ) ENGINE=MyISAM AUTO_INCREMENT=32 DEFAULT CHARSET=latin1 AUTO_INCREMENT=32 ;