gracias
Código PHP:
   <?php require_once('../../Connections/listproduc.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
 
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
 
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
 
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
 
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) {
  $insertSQL = sprintf("INSERT INTO noticias (id, titulo, contenido) VALUES (%s, %s, %s)",
                       GetSQLValueString($_POST['id'], "int"),
                       GetSQLValueString($_POST['titulo'], "text"),
                       GetSQLValueString($_POST['contenido'], "text"));
 
  mysql_select_db($database_listproduc, $listproduc);
  $Result1 = mysql_query($insertSQL, $listproduc) or die(mysql_error());
}
?><?php include ('../../Connections/listproduc.php');
 
 
 
    if (isset($_POST['subir'])) {
 
            extract($_POST);
 
 
 
            if (empty($activo)){
 
            $activo=2;
 
            }
 
 
 
 
 
        $query="INSERT INTO noticias SET
 
        contenido = '$contenido',
 
        titulo = '$titulo'";    
 
        mysql_query($query);
 
                                    
 
        $msj="Su registro ha sido agregado con éxito";
 
    }            
 
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.Estilo16 {color: #FFFFFF}
-->
</style>
<link href="../../css2/estilo.css" rel="stylesheet" type="text/css">
<script language="javascript" type="text/javascript">
function validar_archivo(archivo) {
    var error_archivo;
    error_archivo=0;
      var file=archivo.value;
      
          if (file=="")
          { error_archivo=1; }
          //texto += "\n\nIngrese Foto"
            else{
             
                 // file=document.formulario.FOTO.value
               extArray = new Array(".gif",".jpg");
               // Extension de archivos permitidos
               allowSubmit = false;
                 if (!file) return;
 
                   while (file.indexOf("\\") != -1)
                       file = file.slice(file.indexOf("\\") + 1);
                       ext = file.slice(file.indexOf(".")).toLowerCase();
                   
                   for (var i=0; i < extArray.length; i++){
                          if (extArray[i] == ext){
                             allowSubmit = true;
                             break;
                            }
                    }
 
                        if (!allowSubmit) {
                         error_archivo=2;
                        // texto += "\n\nFOTO: solo admite archivo con la extensión ''gif, .jpeg , .jpg''";
                         }
                            }
                            return error_archivo;
}
 
 
 
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
//-->
</script>
<style type="text/css">
<!--
.style1 {color: #000000}
-->
</style>
</head>
 
<body>
<div align="center">
  <TABLE height=243 cellSpacing=0 cellPadding=0 width=698 
background=../../images2/img/med.gif border=0>
    <CENTER>
      <TBODY>
        <TR>
          <TD width="100%" height=50 align="left" valign="top"><img src="../../images/panel.jpg" width="698" height="100"></TD>
        </TR>
    </CENTER>
    <CENTER>
    </CENTER>
    <TR>
      <TD width="100%" height=160 vAlign=top>
        <TABLE width=698 border=0 cellPadding=0 cellSpacing=0 bordercolor="#FF0000" id=table2>
          <TBODY>
            <TR>
              <TD width="8" vAlign=top > </TD>
              <TD width="156" vAlign=top class="nucomplet" ><?php include("../modulos/indexbarra.php"); ?>
              </TD>
              <TD width=10 vAlign=top> </TD>
              <TD width=13 vAlign=top> </TD>
              <TD width=498 align="center" vAlign=middle class="nucomplet"><span class="unnamed1"><a href="ingresar.php"> Insertar Noticias </a><span class="style1">-</span><a href="listado.php"> Administrar Noticias</a></span>
                <form name="form1" method="post" action="">
                </form>
              
                <form method="post" name="form2" action="<?php echo $editFormAction; ?>">
                  <table align="center">
                    <tr valign="baseline">
                      <td nowrap align="right">Titulo:</td>
                      <td><input type="text" name="titulo" value="" size="32"></td>
                    </tr>
                    <tr valign="baseline">
                      <td nowrap align="right" valign="top">Contenido:</td>
                      <td><textarea name="contenido" cols="30" rows="5"></textarea></td>
                    </tr>
                    <tr valign="baseline">
                      <td nowrap align="right"> </td>
                      <td><input type="submit" value="Insertar"></td>
                    </tr>
                  </table>
                  <input type="hidden" name="id" value="">
                  <input type="hidden" name="MM_insert" value="form2">
                </form>
              <p> </p></TD>
              <TD width=13 vAlign=top> </TD>
            </TR>
          </TBODY>
      </TABLE></TD>
    </TR>
    <TR>
      <TD width="100%" height=33 valign="top" bgcolor="#FFFFFF" class="Estilo16"> </TD>
    </TR>
  </TABLE>
</div>
<p align="center"> </p>
</body>
</html>    
 



