Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/01/2012, 19:17
Avatar de vicion
vicion
 
Fecha de Ingreso: noviembre-2011
Mensajes: 79
Antigüedad: 12 años, 5 meses
Puntos: 1
Añadir boton imagen

hola bueno queria saber si alguien me puede dar una mano en como poner un boton como este para que pueda agregar imagenes a mi post ya q por ahora solo puedo publicar texto.

este es mi codigo:
Código PHP:
Ver original
  1. <?php
  2. header("Content-Type: text/html;charset=utf-8");
  3. // incluimos el archivo de conexion
  4. include ('conexion.php');
  5. // recibimos el formulario
  6. if(isset($_POST['enviar']) && $_POST['enviar'] == 'Enviar'){
  7. // comprobamos que el formulario no envie campos vacios
  8. if(!empty($_POST['notTitulo']) && $_POST['notTexto'] &&
  9. $_POST['notCategoriaID']){
  10. // creamos las variables y les asignamos los valores a insertar
  11. $notTitulo = $_POST['notTitulo'];
  12. $notTexto = $_POST['notTexto'];
  13. $notCategoriaID = $_POST['notCategoriaID'];
  14. // hacemos el INSERT en la BD
  15. $sqlInsertNot = mysql_query("INSERT INTO notiblog
  16. (notTitulo, notTexto, notCategoriaID)
  17. VALUES ('$notTitulo', '$notTexto', '$notCategoriaID')",
  18. $db_link) or die(mysql_error());
  19. // enviamos un mensaje de exito
  20. echo "Los datos fueron gurdados correctamente";
  21. }else{
  22. // si el formulario envia algun campo vacio
  23. // enviamos un mensaje de error
  24. echo "Debe llenar todos los campos del formulario";
  25. }
  26. }
  27. ?>
  28. <!-- el formulario -->
  29. <form name="noticia" action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
  30. <p>
  31. Título de la Noticia<br />
  32. <input type="text" name="notTitulo" size="50" />
  33. </p>
  34. <p>
  35. Texto de la Noticia<br />
  36. <textarea name="notTexto" rows="10" cols="50"></textarea>
  37. </p>
  38. <p>
  39. Categoría<br />
  40. <select name="notCategoriaID">
  41. <option value="">Escoger de la Lista</option>
  42. <?php
  43. // asignamos una categoria a la noticia
  44. // mediante un select
  45. $sqlQueryCat = mysql_query("SELECT * FROM caterina", $db_link)
  46. // creamos un bucle while
  47. // que nos muestre todas las categorias
  48. // que tenemos guardadas en la BD
  49. while($rowCat = mysql_fetch_array($sqlQueryCat)){
  50. echo "<option value='$rowCat[cat_ID]'>$rowCat[catCategoria]</option>";
  51. }
  52. ?>
  53. </select>
  54. </p>
  55. <p>
  56. <input type="submit" name="enviar" value="Enviar" />
  57. </p>
  58. </form>