Ver Mensaje Individual
  #22 (permalink)  
Antiguo 06/08/2011, 15:45
SantosMc03
 
Fecha de Ingreso: agosto-2011
Ubicación: en mi casa
Mensajes: 37
Antigüedad: 12 años, 8 meses
Puntos: 1
Respuesta: falla en leer los mp

Código PHP:
Ver original
  1. <?php
  2. # Incluimos la configuracion
  3. include('config.php');
  4. $c = mysql_connect('host', 'root', 'pass');
  5. mysql_select_db('database');
  6. if($_POST['enviar'])
  7. {
  8.     if(!empty($_POST['para']) && !empty($_POST['asunto']) && !empty($_POST['texto']))
  9.     {
  10.         $fecha = date("DD/MM/AA, g:i a");
  11.         $sql = "INSERT INTO mensaje (para,de,fecha,asunto,texto) VALUES ('".$_POST['para']."','".$_SESSION['s_username']."','".$fecha."','".$_POST['asunto']."','".$_POST['texto']."')";
  12.         mysql_query($sql,$link);
  13.         echo "Mensaje enviado correctamente.";
  14.     }
  15. }
  16. ?>
  17. Menu: <a href="listar.php">Ver mensajes</a> | <a href="crear.php">Crear mensajes</a> | <a href="inicio.php">Volver a inicio</a><br /><br />
  18.  
  19. <form method="post" action="" >
  20. <center><strong>Sistema de mensajes BETA</strong></center></<br /><br />
  21. Para:<br />
  22. <input type="text" name="para" /><br />
  23. Asunto:<br />
  24. <input type="text" name="asunto" /><br />
  25. Mensaje:<br />
  26. <textarea name="texto"></textarea>
  27. <br /><br />
  28. <input type="submit" name="enviar" value="Enviar" />
  29. </form>


ahora me sale este problema

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/a9500782/public_html/crear.php on line 12