Modificacion de codigos php

Páginas: 8 (1918 palabras) Publicado: 19 de julio de 2010
CODIGO GENERADO POR DREAWEAVER

<?php require_once('Connections/brianbd.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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 clientes (id_cliente,nombre_cliente, apellido_cliente, edad_cliente, sexo, observaciones, telefono, direccion, email, fecha_ingreso, celular) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['id_cliente'], "int"),
GetSQLValueString($_POST['nombre_cliente'], "text"),
GetSQLValueString($_POST['apellido_cliente'], "text"),GetSQLValueString($_POST['edad_cliente'], "int"),
GetSQLValueString($_POST['sexo'], "text"),
GetSQLValueString($_POST['observaciones'], "text"),
GetSQLValueString($_POST['telefono'], "int"),
GetSQLValueString($_POST['direccion'], "text"),GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['fecha_ingreso'], "date"),
GetSQLValueString($_POST['celular'], "int"));

mysql_select_db($database_brianbd, $brianbd);
$Result1 = mysql_query($insertSQL, $brianbd) or die(mysql_error());
}
?><!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=iso-8859-1" />
<title>Documento sin título</title>
</head>

<body>
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
<table align="center">
<trvalign="baseline">
<td nowrap align="right">Id_cliente:</td>
<td><input type="text" name="id_cliente" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Nombre_cliente:</td>
<td><input type="text" name="nombre_cliente" value="" size="32"></td>
</tr><tr valign="baseline">
<td nowrap align="right">Apellido_cliente:</td>
<td><input type="text" name="apellido_cliente" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Edad_cliente:</td>
<td><input type="text" name="edad_cliente" value="" size="32"></td></tr>
<tr valign="baseline">
<td nowrap align="right">Sexo:</td>
<td><input type="text" name="sexo" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Observaciones:</td>
<td><input type="text" name="observaciones" value="" size="32"></td>...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Codigo php
  • Modificacion codigo aduanero
  • modificacion del codigo civil
  • Modificacion Del Codigo Civil
  • Codigo de calculadora con php
  • Utopia y la modificacion al código laboral dominicano
  • Guia de Codigos para modificacion SUNAT
  • Modificacion del articulo 97 codigo tributario

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS