bueno y no solo me pasa en ese formulario sino tambien en este:
[PHP]
Código PHP:
<?php require_once('../../Connections/Activos3.php');?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
$logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
//to fully log out a visitor we need to clear the session varialbles
$_SESSION['MM_Username'] = NULL;
$_SESSION['MM_UserGroup'] = NULL;
$_SESSION['PrevUrl'] = NULL;
unset($_SESSION['MM_Username']);
unset($_SESSION['MM_UserGroup']);
unset($_SESSION['PrevUrl']);
$logoutGoTo = "../../index.php";
if ($logoutGoTo) {
header("Location: $logoutGoTo");
exit;
}
}
?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "3";
$MM_donotCheckaccess = "false";
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
$isValid = False;
set equal to their username.
blank.
if (!empty($UserName)) {
on an ID established when they login.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && false) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "../../index.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?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']);
}
{
$insertSQL = sprintf("INSERT INTO empresas (empresa, contacto, direccion, departamento, municipio, cod_postal, telefono, fax, celular, correo, notas) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['empresa'], "text"),
GetSQLValueString($_POST['contacto'], "text"),
GetSQLValueString($_POST['direccion'], "text"),
GetSQLValueString($_POST['departamento'], "text"),
GetSQLValueString($_POST['municipio'], "text"),
GetSQLValueString($_POST['cod_postal'], "text"),
GetSQLValueString($_POST['telefono'], "text"),
GetSQLValueString($_POST['fax'], "text"),
GetSQLValueString($_POST['celular'], "text"),
GetSQLValueString($_POST['correo'], "text"),
GetSQLValueString($_POST['notas'], "text"));
}
?>
Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Añadir Vehiculo</title>
<link href="../../CSS/estilo.css" rel="stylesheet" type="text/css" />
<?php include("../../JS/calendario.php"); ?>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.Estilo1 {
font-size: 1em
}
-->
</style>
</head>
<body>
<script language="JavaScript">
<!-- Por Carlitos. Cualquier duda o pregunta, visita www.forosdelweb.com
var ancho=400
var alto=475
var fin=750
var x=20
var y=20
function inicio()
{
ventana = window.open("../../email/mailattach.php", "_blank", "resizable,height=1,width=1,top=x,left=y,screenX=x,screenY=y");
abre();
}
function abre()
{
if (ancho<=fin) {
ventana.moveTo(5,5); // fijos
ventana.resizeTo(400,515); //fijos
timer= setTimeout("abre()",5)
}
else {
clearTimeout(timer)
}
}
// -->
</script>
<div id="borde">
<div id="contenedor">
<div id="cabecera">
<img src="http://www.forosdelweb.com/Imagenes/Titulo3.PNG" alt="Sistema de Inventario" border="0" class="imagen" /></div>
<div id="cuerpo">
<div if="formulario">
<h2>AÑadir Empresa</h2>
<p>Por favor ingrese los datos de la Empresa en el siguiente formulario.</p>
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1" >
<table align="center">
<tr valign="baseline">
<td align="right" nowrap="nowrap" class="inserta_tablas1"><strong>Empresa:</strong></td>
<td class="inserta_tablas2"><input name="empresa" type="text" id="empresa" value="" size="32" /> </td>
</tr>
<tr valign="baseline">
<td align="right" nowrap="nowrap" class="inserta_tablas1"><strong>Contacto:</strong></td>
<td class="inserta_tablas2"><input name="contacto" type="text" id="contacto" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap="nowrap" class="inserta_tablas1">Direccion:</td>
<td class="inserta_tablas2"><input name="direccion" type="text" id="direccion" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap="nowrap" class="inserta_tablas1"><strong>Departamento:</strong></td>
<td class="inserta_tablas2"><input name="departamento" type="text" id="departamento" value="" size="32" /> </td></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap="nowrap" class="inserta_tablas1"><strong>Municipio:</strong></td>
<td class="inserta_tablas2"><input name="municipio" type="text" id="municipio" value="" size="32" /> </td></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap="nowrap" class="inserta_tablas1"><strong>Codigo Postal:</strong></td>
<td class="inserta_tablas2"><input name="cod_postal" type="text" id="cod_postal" value="" size="32" /> </td></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap="nowrap" class="inserta_tablas1"><strong>Telefono:</strong></td>
<td class="inserta_tablas2"><input name="telefono" type="text" id="telefono" value="" size="10" />
Fax:
<input name="fax" type="text" id="fax" value="" size="10" />
Celular:
<input name="celular" type="text" id="celular" value="" size="10" /></td>
</tr>
<tr valign="baseline"> </tr>
<tr valign="baseline">
<td align="right" nowrap="nowrap" class="inserta_tablas1"><strong>Correo:</strong></td>
<td class="inserta_tablas2"><input name="correo" type="text" id="correo" value="" size="32" /></td></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap="nowrap" class="inserta_tablas1"><strong>Notas:</strong></td>
<td class="inserta_tablas2"><input name="notas" type="text" id="notas" value="" size="32" /></td>
</tr>
<tr valign="baseline"> </tr>
</table>
<table align="center">
<tr valign="baseline">
</tr>
<tr valign="baseline">
<td align="right" nowrap="nowrap" class="inserta_tablas1"> </td>
<td class="inserta_tablas2"><input type="submit" value="Insertar registro" onclick="return Activo()"/>
<label>
<input type="reset" name="button" id="button" value="Restablecer" />
</label></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
</form></div><!-- Cierra la TAbla --></div>
<div id="pie">
<p> </p>
<p>Sistema de Gestion Vehicular Realizado por <a href= "nuevo_activo.php" class="enlacenav" onclick="inicio()"title= "Enviar E-Mail">Anward Acosta © 2009</a></p>
</div>
</div>
</div>
<?php
?>
<p> </p>
</body>
</html>
Tampoco me guarda nada y no se por que en la db solo tengo
CREATE TABLE IF NOT EXISTS `empresas` (
`empresa` varchar(50)
COLLATE latin1_spanish_ci NOT NULL, todas estan con esta linea
`contacto` varchar(50) ,
`direccion` varchar(100) ,
`departamento` varchar(50) ,
`municipio` varchar(50),
`cod_postal` varchar(100),
`telefono` varchar(15) ,
`fax` varchar(30) NOT NULL,
`celular` varchar(30),
`correo` varchar(20),
`notas` varchar(300),
PRIMARY KEY (`empresa`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_spanish_ci ROW_FORMAT=COMPACT;