Jump to content
php.lv forumi

Recommended Posts

Posted

Visu ustajsiju ka nakas bet rada tukša lap wtf ?

PhpMyAdmin

afvd0ugtsf3ncj4kdc1q_thumb.gif

 

userinfo.php

<?php
include("includes/db_connect.php");

if(isset($_GET['UserID']))
{
$id = $_GET['UserID'];

$query = "SELECT * FROM users WHERE id = '$id'";

$result = mysql_query($query) or die(mysql_error());


$row = mysql_fetch_array($result) or die(mysql_error());
echo "Username:";
echo $row['Username'];
echo "<br />";
echo "Your password:";
echo $row['Password'];
echo "<br />";
echo "Your E-mail:";
echo $row['EmailAddress'];
echo "<br />";
echo "Your name:";
echo $row['Name'];

}

?>
<br>
[<a href="logout.php">Logout</a>]

 

ka lai izlabo ? :/

Posted

Adreses laukā tev ir kāda adrese ierakstīta? Šāda tipa (ne tieši tāda, skaties uz to jautājuma zīmi un kas seko pēc tam)?

 

http://localhost/profile.php?UserID=3

 

Un kad tu atver to lapu, kur vajadzētu parādīties tam lietotājam - tev rādās tur [Logout] links?

Posted

kāda jēga no mysql_error, ja tu tos nelasi?

nevaru ieraudzīt tabulā tādu lauku, kā "id". pārējo izdomāsi...

Posted (edited)

pasties mana PhpMyAdmin tur ir UserId

un es ari padomaju ka id iet no turienes ;/

Edited by FT3
Posted

Taisnība ir Val (nepaskatīju attēlu).

 

Tev vajag rakstīt nevis:

"SELECT * FROM users WHERE id = '$id'"

 

bet gan

"SELECT * FROM users WHERE UserID = '$id'"

Posted

viss kods tagad iskatas ta

<?php
include("db_connect.php");

if(isset($_GET['UserID']))
{
$id = $_GET['UserID'];

$query = "SELECT * FROM users WHERE UserID = '$id'"

$result = mysql_query($query) or die(mysql_error());


$row = mysql_fetch_array($result) or die(mysql_error());
echo "Username:";
echo $row['username'];
echo "<br />";
echo "Your password:";
echo $row['password'];
echo "<br />";
echo "Your E-mail:";
echo $row['email'];
echo "<br />";
echo "Your name:";
echo $row['name'];

}

?>
<br>
[<a href="logout.php">Logout</a>]

bet rada eroru

Parse error: syntax error, unexpected T_VARIABLE in C:\AppServ\www\v2\includes\user_cp.php on line 10

×
×
  • Create New...