Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/08/2011, 18:22
Avatar de Most
Most
 
Fecha de Ingreso: marzo-2009
Mensajes: 642
Antigüedad: 15 años, 1 mes
Puntos: 6
no me sube datos a BD desde mismo script que el form

Hola, resulta que tengo este codigo, que sirve "se supone" para no tener que estar mandando a otro archivo (ejem: upload.php), bien, lo que tiene que hacer supuestamente es cojer los datos que manda el form y mandarlos al if de post "re:supuestamente" pero no es asi, haber si podeis ayudarme ;):

Código PHP:
<? if($_POST[datos]){ 
$connect=mysql_connect("xxxxxx","xxxxxx","xxxxxx"); 
mysql_select_db("xxxxxx",$connect);
$autor=$_POST['autor'];
$titulo=$_POST['titulo'];
$urlforo=$_POST['urlforo'];
$imagen=$_POST['imagen'];
$articulo=$_POST['articulo'];
$sql "INSERT INTO noticias_scene VALUES(NULL, '$autor', '$titulo', $urlforo, '$imagen', NOW(), '$articulo')";
mysql_query($sql$connect) or die("Tuve un error en: " mysql_error() . "<br />Con la consulta: " $sql); 
?>
<script type="text/javascript" src="ed.js"></script>  
<form id="nueva_noticia" action="" name="datos" method="post"> 
  <table style="float:left;" width="200" height="103" border="0">
    <tr>
      <td>  <p>Titulo noticia:<br> 
    <input type="text" name="titulo">
        <p>          <br>
      </td>
    </tr>
    <tr>
      <td>    <p>Imagen (URL):<br>
        <input type="text" name="imagen">
        </p>
        <p><br>
        </p></td>
    </tr>
    <tr>
      <td>    Noticia en foro (URL):<br>
    <input type="text" name="urlforo"></td>
    </tr>
  </table>
  <table width="200" height="144" border="0">
    <tr>
      <td height="140">    <script>edToolbar('articulo'); </script>
    <textarea name="articulo" id="articulo" class="ed" style=" height: 145px; width: 430px;" cols="50" rows="10"></textarea></td>
    </tr>
  </table>
    <input style="visibility:hidden;" type="text" name="autor" value="most"><br>
    <table width="623" height="24" border="0">
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table>
    <table width="624" border="0">
      <tr>
        <td width="5">&nbsp;</td>
        <td width="429">&nbsp;</td>
        <td width="81"><input class="boton" value="Visualizar"></td>
        <td width="81"><input class="boton" type="submit" value="Publicar"></td>
      </tr>
    </table>
</form>