Ver Mensaje Individual
  #5 (permalink)  
Antiguo 08/05/2007, 08:16
Juny18
 
Fecha de Ingreso: abril-2007
Mensajes: 166
Antigüedad: 17 años, 1 mes
Puntos: 2
Re: Cambio clave Dreamweaver

Ola a todos de nuevo, gracias por interntar ayudarme.

¿Pero donde pongo el código que me han dicho?¿En que parte de la página lo pongo?
Tiene que ser en la misma página del formulario, no puede ser en otra pagina, es decir, que la pagina donde tengo el formulario es html y tiene partes de php.

Este código es el que me crea el Dreamweaver (antes de poner en la Web <html> para empezar a crearla) cuando le puse el comportamiento de servidor de "insertar datos" . Donde debo poner sus codigos. Es que no soy muy expertar en programación Web


Código HTML:
<?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"] == "formularioregistro")) {
  $insertSQL = sprintf("INSERT INTO usuario (nombre, clave, confirmacion_clave, e_mail, pais, codigo_postal, genero, dia_nacimiento, mes_nacimiento, ano_nacimiento) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['login'], "text"),
                       GetSQLValueString($_POST['clave'], "text"),
                       GetSQLValueString($_POST['confirmclave'], "text"),
                       GetSQLValueString($_POST['e-mail'], "text"),
                       GetSQLValueString($_POST['pais'], "text"),
                       GetSQLValueString($_POST['cp'], "int"),
                       GetSQLValueString($_POST['genero'], "text"),
                       GetSQLValueString($_POST['fndia'], "int"),
                       GetSQLValueString($_POST['fnmes'], "text"),
                       GetSQLValueString($_POST['fnaño'], "int"));

  mysql_select_db($database_conexion7, $conexion7);
  $Result1 = mysql_query($insertSQL, $conexion7) or die(mysql_error());

  $insertGoTo = "index6c.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}


?> 
¿Hay otra opcion, que no sea muy dificil?

Si hubiera alguna solución que sea en modo gráfico ¿me podrian indicar como?.
Bueno si fuera en modo código también, XD XD. Pero me interesa más el modo grafico (mucho más fácil,jaja)

Thank's