Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/07/2013, 17:34
indpendient
 
Fecha de Ingreso: noviembre-2009
Mensajes: 42
Antigüedad: 14 años, 5 meses
Puntos: 0
Crear registro para cada usuario diferente

Hola amigos intento crear una web donde los usuarios se registren y ya registrado tenga un direccionamiento a su propia web. que esta seria una web que imprima los datos que tenga la base de datos del usuario lo guiado.

tengo esto que pude hacer de este video http://www.youtube.com/watch?v=0b0XyrfkwQA

tengo este código en la pagina de loguin
<?php require_once('Connections/will.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;
}
}
?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset($_POST['textfield'])) {
$loginUsername=$_POST['textfield'];
$password=$_POST['textfield2'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "index.php";
$MM_redirectLoginFailed = "login.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_will, $will);

$LoginRS__query=sprintf("SELECT Nombre, Contrasena FROM Usuarios WHERE Nombre=%s AND Contrasena=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));

$LoginRS = mysql_query($LoginRS__query, $will) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";

//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;

if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>
y el formulario que regoge los datos es este

<form id="form1" name="form1" method="POST" action="<?php echo $loginFormAction; ?>">
<p>
<label>
<input type="text" name="textfield" id="textfield" />
<br />
</label>
Clave:</p>
<p>
<label>
<input type="password" name="textfield2" id="textfield2" />
</label>
</p>
<p>
<label>
<input type="submit" name="submit" value="Iniciar" />
</label>
</p>
</form></td>

tengo otra pagina que es donde extraer los datos que se llama index
donde pienso extraer los datos de la tabla de esta forma


<?php
mysql_select_db($database_will, $will);
$sql="select * from Usuarios";
$datos=mysql_query($sql,$will);
echo "<table>";
while($renglon=mysql_fetch_array($datos))
{
echo "<tr>";
echo"Hola";
echo " <tr>" . $renglon['Nombre'] . "</tr>";
echo " <tr>" . $renglon['Emal'] . "</tr>";
?>

como puedo hacer esto? eh pensando que tengo que crear un codigo que balla directo al ID de cada usuario pero no tengo mucha dea de como hacerlo ayuda men por favor.