Ver Mensaje Individual
  #2 (permalink)  
Antiguo 24/08/2011, 19:07
Avatar de skiper0125
skiper0125
 
Fecha de Ingreso: octubre-2010
Ubicación: $this->Mexico('Toluca');
Mensajes: 1.127
Antigüedad: 13 años, 6 meses
Puntos: 511
Respuesta: no me sube datos a BD desde mismo script que el form

Hola que tal.

configura el action de tu form

Código HTML:
Ver original
  1. <form id="nueva_noticia" action=" tu_pagina" name="datos" method="post">

y verifica que te lleguen las variables con var_dump($_POST);

o prueba con esto y comentas, pero recuerda configura el action de tu form

Código PHP:
Ver original
  1. <?
  2. if(!empty($_POST['Publicar'])){
  3.     var_dump($_POST);
  4.     $connect=mysql_connect("xxxxxx","xxxxxx","xxxxxx");
  5.     mysql_select_db("xxxxxx",$connect);
  6.     $autor=$_POST['autor'];
  7.     $titulo=$_POST['titulo'];
  8.     $urlforo=$_POST['urlforo'];
  9.     $imagen=$_POST['imagen'];
  10.     $articulo=$_POST['articulo'];
  11.     $sql = "INSERT INTO noticias_scene VALUES(NULL, '$autor', '$titulo', $urlforo, '$imagen', NOW(), '$articulo')";
  12.     mysql_query($sql, $connect) or die("Tuve un error en: " . mysql_error() . "<br />Con la consulta: " . $sql);
  13. }
  14. ?>
  15. <script type="text/javascript" src="ed.js"></script>  
  16. <form id="nueva_noticia" action="" name="datos" method="post">
  17.   <table style="float:left;" width="200" height="103" border="0">
  18.     <tr>
  19.       <td>  <p>Titulo noticia:<br>
  20.     <input type="text" name="titulo">
  21.         <p>          <br>
  22.       </td>
  23.     </tr>
  24.     <tr>
  25.       <td>    <p>Imagen (URL):<br>
  26.         <input type="text" name="imagen">
  27.         </p>
  28.         <p><br>
  29.         </p></td>
  30.     </tr>
  31.     <tr>
  32.       <td>    Noticia en foro (URL):<br>
  33.     <input type="text" name="urlforo"></td>
  34.     </tr>
  35.   </table>
  36.   <table width="200" height="144" border="0">
  37.     <tr>
  38.       <td height="140">    <script>edToolbar('articulo'); </script>
  39.     <textarea name="articulo" id="articulo" class="ed" style=" height: 145px; width: 430px;" cols="50" rows="10"></textarea></td>
  40.     </tr>
  41.   </table>
  42.     <input style="visibility:hidden;" type="text" name="autor" value="most"><br>
  43.     <table width="623" height="24" border="0">
  44.       <tr>
  45.         <td>&nbsp;</td>
  46.       </tr>
  47.     </table>
  48.     <table width="624" border="0">
  49.       <tr>
  50.         <td width="5">&nbsp;</td>
  51.         <td width="429">&nbsp;</td>
  52.         <td width="81"><input class="boton" value="Visualizar"></td>
  53.         <td width="81"><input class="boton" type="submit" value="Publicar" id="Publicar" name="Publicar"></td>
  54.       </tr>
  55.     </table>
  56. </form>

Saludos
__________________
Recuerda que estamos aquí para orientarte, y no para hacer tu trabajo.
Si mi aporte fue de ayuda, recuerda que agradecer no cuesta nada +1

Skiper0125

Última edición por skiper0125; 24/08/2011 a las 19:16