Ver Mensaje Individual
  #7 (permalink)  
Antiguo 16/06/2008, 09:09
Avatar de T4ke0veR
T4ke0veR
 
Fecha de Ingreso: agosto-2007
Ubicación: Quito - Ecuador
Mensajes: 1.720
Antigüedad: 16 años, 9 meses
Puntos: 28
Respuesta: Comprobar si usuario existe

es un codigo q se diseño en dreamweaver posteriormente... ahora solo incluyo el otro... muestro codigo hasta el form pues no hay mas
Código PHP:
<?php require_once('Connections/pintor.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 factura (id, factura, tienda, monto, cedula) VALUES (%s, %s, %s, %s, %s)",
                       
GetSQLValueString($_POST['id'], "int"),
                       
GetSQLValueString($_POST['factura'], "text"),
                       
GetSQLValueString($_POST['tienda'], "text"),
                       
GetSQLValueString($_POST['monto'], "text"),
                       
GetSQLValueString($_POST['cedula'], "text"));

  
mysql_select_db($database_pintor$pintor);
  
$Result1 mysql_query($insertSQL$pintor) or die(mysql_error());

  
$insertGoTo "gracreg.php";
  if (isset(
$_SERVER['QUERY_STRING'])) {
    
$insertGoTo .= (strpos($insertGoTo'?')) ? "&" "?";
    
$insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  
header(sprintf("Location: %s"$insertGoTo));
}
?>
ese es en insert q esta en la misma pagina
__________________
Diseño gráfico, Web, imagen corporativa, publicidad ...