programes wordpress botón es muy problemas
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-admin\menu-header.php:94) in C:\xampp\htdocs\wordpress\wp-content\plugins\menu\nuevo.php on line 52
Código PHP:
<?php plugins_url (require_once( '/Connections/wordpress.php')); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$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"] == "form1")) {
$insertSQL = sprintf("INSERT INTO cmj_menu (nombre, imagenes, imagenes1, imagenes2, imagenes3, imagenes4, texto) VALUES (%s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['nombre'], "text"),
GetSQLValueString($_POST['imagenes'], "text"),
GetSQLValueString($_POST['imagenes1'], "text"),
GetSQLValueString($_POST['imagenes2'], "text"),
GetSQLValueString($_POST['imagenes3'], "text"),
GetSQLValueString($_POST['imagenes4'], "text"),
GetSQLValueString($_POST['texto'], "text"));
mysql_select_db($database_wordpress, $wordpress);
$Result1 = mysql_query($insertSQL, $wordpress) or die(mysql_error());
if(isset($_POST['submit'])) {
header(plugins_url('Location: /admin.php?page=menu/editar.php'));
exit;
}
}
mysql_select_db($database_wordpress, $wordpress);
$query_menu = "SELECT * FROM cmj_menu";
$menu = mysql_query($query_menu, $wordpress) or die(mysql_error());
$row_menu = mysql_fetch_assoc($menu);
$totalRows_menu = mysql_num_rows($menu);
mysql_free_result($menu);
?>
<p>Menu de comida</p>
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
<table align="center">
<tr valign="baseline">
<td nowrap="nowrap" align="right">Nombre:</td>
<td><input type="text" name="nombre" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Imagenes:</td>
<td><input type="text" name="imagenes" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Imagenes1:</td>
<td><input type="text" name="imagenes1" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Imagenes2:</td>
<td><input type="text" name="imagenes2" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Imagenes3:</td>
<td><input type="text" name="imagenes3" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Imagenes4:</td>
<td><input type="text" name="imagenes4" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Texto:</td>
<td><input type="text" name="texto" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> </td>
<td><input name="submit" type="submit" id="submit" value="Insertar registro" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
</form>
<p> </p>