Foros del Web » Programando para Internet » PHP »

alguien me puede decir cual es el error que tengo?

Estas en el tema de alguien me puede decir cual es el error que tengo? en el foro de PHP en Foros del Web. http://www.youtube.com/watch?v=toSB7Q5T3Gs pues estoy siguiendo un videotutoria de como hacer una red social y pues hice todo lo que dic el muchacho pero aun no consigo ...
  #1 (permalink)  
Antiguo 07/03/2014, 16:00
Avatar de JoseAlberth  
Fecha de Ingreso: marzo-2014
Mensajes: 23
Antigüedad: 10 años, 1 mes
Puntos: 0
Pregunta alguien me puede decir cual es el error que tengo?

http://www.youtube.com/watch?v=toSB7Q5T3Gs


pues estoy siguiendo un videotutoria de como hacer una red social y pues hice todo lo que dic el muchacho pero aun no consigo que me diga que la contrasela esta en usoo el registro funciona perfectamente pero al momento de meter una direccion duplicada no me hace nada que hago gracias

<?php require_once('Connections/conexionredsocial.php'); ?>
<?php
$user="";
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;
}
}

// *** Redirect if username exists
$MM_flag="MM_insert";
if (isset($_POST[$MM_flag])) {
$user="yaexiste";
$MM_dupKeyRedirect="Home.php";
$loginUsername = $_POST['email'];
$LoginRS__query = sprintf("SELECT email FROM usuario WHERE email=%s", GetSQLValueString($loginUsername, "text"));
mysql_select_db($database_conexionredsocial, $conexionredsocial);
$LoginRS=mysql_query($LoginRS__query, $conexionredsocial) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);

//if there is a row in the database, the username was found - can not add the requested username
if($loginFoundUser){
$MM_qsChar = "?";
//append the username to the redirect page
if (substr_count($MM_dupKeyRedirect,"?") >=1) $MM_qsChar = "&";
$MM_dupKeyRedirect = $MM_dupKeyRedirect . $MM_qsChar ."user=".$loginUsername;
header ("Location: $MM_dupKeyRedirect");
exit;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}





if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1" && $user = "yaexiste")) {
if($_POST['sexo']==1){$sexo="Mujer";}else{$sexo="Hombre";}
$fecha = $_POST['anio']."-".$_POST['mes']."-".$_POST['dia'];
mkdir("archivos/".$_POST['email']);
$nombrefoto=$_FILES['fotos']['name'];
move_uploaded_file($_FILES['fotos']['tmp_name'],"archivos/".$_POST['email']."/".$nombrefoto);

$insertSQL = sprintf("INSERT INTO usuario (email, pass, fechanac, nombre, sexo, status, fotos) VALUES (%s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['pass'], "text"),
GetSQLValueString($fecha, "date"),
GetSQLValueString($_POST['nombre'], "text"),
GetSQLValueString($sexo, "text"),
GetSQLValueString($_POST['status'], "text"),
GetSQLValueString($nombrefoto, "text"));

mysql_select_db($database_conexionredsocial, $conexionredsocial);
$Result1 = mysql_query($insertSQL, $conexionredsocial) or die(mysql_error());

$insertGoTo = "usuario_alta_paso2.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ejemplo ejercicio</title>
<meta name="description" content="">


<link rel="stylesheet" href="_css/principal.css">
<link href='http://fonts.googleapis.com/css?family=Lato:300,400,700|Kite+One' rel='stylesheet' type='text/css'>

<script src="js/jquery-1.11.0.min.js"></script>
<script src="js/jquery.imageLens.js"></script>

<script>

$(document).ready(function(){

$("#ejemplo").imageLens();
$("#ejemplo1").imageLens({ lensSize: 300 });
$("#ejemplo2").imageLens({ imageSrc: "img/02.jpg", lensSize: 120 });
$("#ejemplo3").imageLens({ imageSrc: "img/02.jpg", lensSize: 120 })


});
</script>

</head>

<body>

<div id="container">
<header>
<div id="header-content">

<nav>

</nav>
<img src="imagenes/logoN.png" width="162" height="51" alt=""/>

</div>
</header>
<div id="banner">
<h2>¡Bienvenidos a neptune!</h2>
<h3>vamos en crecimiento</h3>
</div>

<section>
<h3>Regsitrate ahora</h3>
<div id="acercaDe">
<? if($user=="yaexiste")?> Ya existe un usuario con esta direccion de correo electronico <? echo $_GET('user'); ?>
<form method="POST" name="form1" action="<?php echo $editFormAction; ?>" enctype="multipart/form-data">
<table align="center">
<tr valign="baseline">
<td nowrap align="right">Correo electronicol:</td>
<td><input type="text" name="email" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Contraseña:</td>
<td><input type="password" name="pass" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Fecha de nacimiento:</td>
<td><select name="dia" id="dia"><option value="-1">Día:</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option><option value="31">31</option></select>

<select name="mes" id="mes" aria-label="Mes" ><option value="-1">Mes:</option></select>
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Nombre:</td>
<td><input type="text" name="nombre" value="" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Sexo:</td>

<td><input type="radio" name="sexo" value="1" />Mujer<input type="radio" name="sexo" value="2" />
Hombre</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Fotos:</td>
<td><input type="file" name="fotos" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">&nbsp;</td>
<td><input type="submit" value="Registrar"></td>
</tr>
</table>
<input type="hidden" name="status" value="activo">
<input type="hidden" name="MM_insert" value="form1">
</form>
<p>&nbsp;</p>
</div></section>

<section>
<h3>Mi imageLens</h3>
<div id="imageLens">

<p><img id="ejemplo" src="img/01.jpg" width="400" height="250" /></p>
<p><img id="ejemplo1" src="img/01.jpg" width="400" height="250" /></p>
<p><img id="ejemplo2" src="img/01.jpg" width="400" height="250" /></p>

</div>





</div></section>

</div>



</body></html>
  #2 (permalink)  
Antiguo 07/03/2014, 16:01
Avatar de JoseAlberth  
Fecha de Ingreso: marzo-2014
Mensajes: 23
Antigüedad: 10 años, 1 mes
Puntos: 0
Respuesta: alguien me puede decir cual es el error que tengo?

el video esta aca: http://www.youtube.com/watch?v=toSB7Q5T3Gs

Etiquetas: decir, fecha, html, mysql, registro, select, sql
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 17:02.