Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php require_once('Connections/config.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"] == "register")) {
- $insertSQL = sprintf("INSERT INTO microb (Nombre, Apellido, Pais, Ciudad, Usuario, Password, Email) VALUES (%s, %s, %s, %s, %s, %s, %s)",
- GetSQLValueString($_POST['Nombre'], "text"),
- GetSQLValueString($_POST['Apellido'], "text"),
- GetSQLValueString($_POST['Pais'], "text"),
- GetSQLValueString($_POST['Ciudad'], "text"),
- GetSQLValueString($_POST['Usuario'], "text"),
- GetSQLValueString($_POST['Password'], "text"),
- GetSQLValueString($_POST['Email'], "text"));
- mysql_select_db($database_config, $config);
- $Result1 = mysql_query($insertSQL, $config) or die(mysql_error());
- $insertGoTo = "success.php";
- if (isset($_SERVER['QUERY_STRING'])) {
- $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
- $insertGoTo .= $_SERVER['QUERY_STRING'];
- }
- header(sprintf("Location: %s", $insertGoTo));
- }
- mysql_select_db($database_config, $config);
- $query_config = "SELECT * FROM microb";
- $config = mysql_query($query_config, $config) or die(mysql_error());
- $row_config = mysql_fetch_assoc($config);
- $totalRows_config = mysql_num_rows($config);
- ?><head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Microblogging - Register</title>
- <link href="style.css" rel="stylesheet" type="text/css" />
- </head>
- <body class="body">
- <div class="logo"></div>
- <div class="register">
- <div class="bienvenida" align="center"><a>
- <p>Ingresa toda la informacion necesaria</p>
- <p> para poder formar parte de nuestra red social .</p>
- </div>
- <div class="register2" align="right">
- <form name="register" method="POST" action="<?php echo $editFormAction; ?>">
- <label>Nombre:
- <input type="text" name="Nombre" class="form2">
- </label>
- <p>
- <label>Apellido:
- <input type="text" name="Apellido" class="form2">
- </label>
- </p>
- <p>
- <label>Pais:
- <input type="text" name="Pais" class="form2">
- </label>
- </p>
- <p>
- <label>Ciudad:
- <input type="text" name="Ciudad" class="form2">
- </label>
- </p>
- <p>
- <label>Usuario:
- <input type="text" name="Usuario" class="form2">
- </label>
- </p>
- <p>
- <label>Password:
- <input type="text" name="Password" class="form2">
- </label>
- </p>
- <p>
- <label>Email:
- <input type="text" name="Email" class="form2">
- </label>
- </p>
- <p>
- <label>
- <input type="submit" name="submit" value="Registrarme" class="conectar">
- </label>
- </p>
- <input type="hidden" name="MM_insert" value="register">
- </form>
- </div>
- </div>
- <div class="footer">
- <div class="copyright" align="center">Microblogging © 2011 · Inicio | Acerca de | Terminos de uso | Privacidad | Contactenos</div>
- </div>
- </body>
- </html><?php
- mysql_free_result($config);
- ?>
Add Comment
Please, Sign In to add comment