Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php require_once('../Connections/Cursoweb.php'); ?>
- <?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;
- }
- }
- $currentPage = $_SERVER["PHP_SELF"];
- $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 usuarios (Id, Nombre, Email, `Url Web`, Usuario, Contrasena) VALUES (%s, %s, %s, %s, %s, %s)",
- GetSQLValueString($_POST['Id'], "int"),
- GetSQLValueString($_POST['Nombre'], "text"),
- GetSQLValueString($_POST['Email'], "text"),
- GetSQLValueString($_POST['Url_Web'], "text"),
- GetSQLValueString($_POST['Usuario'], "text"),
- GetSQLValueString($_POST['Contrasena'], "text"));
- $Result1 = mysqli_query($Cursoweb, $insertSQL) or die(mysqli_error());
- }
- $maxRows_Recordset1 = 10;
- $pageNum_Recordset1 = 0;
- if (isset($_GET['pageNum_Recordset1'])) {
- $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
- }
- $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
- $query_Recordset1 = "SELECT * FROM usuarios";
- $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
- $Recordset1 = mysqli_query($Cursoweb, $query_limit_Recordset1) or die(mysqli_error());
- $row_Recordset1 = mysqli_fetch_assoc($Recordset1);
- if (isset($_GET['totalRows_Recordset1'])) {
- $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
- } else {
- $all_Recordset1 = mysqli_query($Cursoweb, $query_Recordset1);
- $totalRows_Recordset1 = mysqli_num_rows($all_Recordset1);
- }
- $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
- $queryString_Recordset1 = "";
- if (!empty($_SERVER['QUERY_STRING'])) {
- $params = explode("&", $_SERVER['QUERY_STRING']);
- $newParams = array();
- foreach ($params as $param) {
- if (stristr($param, "pageNum_Recordset1") == false &&
- stristr($param, "totalRows_Recordset1") == false) {
- array_push($newParams, $param);
- }
- }
- if (count($newParams) != 0) {
- $queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
- }
- }
- $queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);
- ?>
- <!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>Documento sin título</title>
- <script src="../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
- <link href="../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
- <table align="center">
- <tr valign="baseline">
- <td nowrap="nowrap" align="right">Id:</td>
- <td><input type="text" name="Id" value="" size="32" /></td>
- </tr>
- <tr valign="baseline">
- <td nowrap="nowrap" align="right">Nombre:</td>
- <td><input type="text" name="Nombre" value="" size="32" /></td>
- </tr>
- <tr valign="baseline">
- <td nowrap="nowrap" align="right">Email:</td>
- <td><input type="text" name="Email" value="@" size="32" /></td>
- </tr>
- <tr valign="baseline">
- <td nowrap="nowrap" align="right">Url Web:</td>
- <td><input type="text" name="Url_Web" value="http://" size="32" /></td>
- </tr>
- <tr valign="baseline">
- <td nowrap="nowrap" align="right">Usuario:</td>
- <td><input type="text" name="Usuario" value="" size="32" /></td>
- </tr>
- <tr valign="baseline">
- <td nowrap="nowrap" align="right">Contrasena:</td>
- <td><input type="password" name="Contrasena" value="" size="32" /></td>
- </tr>
- <tr valign="baseline">
- <td nowrap="nowrap" align="right"> </td>
- <td><input type="submit" class="textfieldFlashText" value="Registrarse" />
- </tr>
- </table>
- <input type="hidden" name="MM_insert" value="form1" />
- </form>
- <form id="form2" name="form2" method="post" action="">
- <input type="radio" name="radio" id="radio" value="radio" />
- <label for="radio">Acepto <a href="Registrousuario.php" title="TERMINOS Y CONDICIONES" target="_top"><a href="terminosycondiciones.php" title="Terminos y Condiciones" target="_top"><a href="terminosycondiciones.php" title="Terminos y Condciones" target="_top">Terminos y condiciones</a></a></a></label>
- </form>
- <span id="sprytextfield1">
- <label for="text1"></label>
- <span class="textfieldRequiredMsg">Se necesita un valor.</span></span>
- <p> </p>
- <script type="text/javascript">
- var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
- </script>
- </body>
- </html>
- <?php
- mysqli_free_result($Recordset1);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement