FT3 Posted October 23, 2009 Report Posted October 23, 2009 Visu ustajsiju ka nakas bet rada tukša lap wtf ? PhpMyAdmin 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 ? :/
rATRIJS Posted October 23, 2009 Report Posted October 23, 2009 Un tev ir tāds $_GET["UserID"]? Tam būtu jāizskatās šādi - http://tava.adrese.lv/profils.php?UserID=4 Tev lapā ko atver rāda Logout?
FT3 Posted October 23, 2009 Author Report Posted October 23, 2009 isti nezinu ar to UserID meginaj usavienot un sanaca itka ta ;/
rATRIJS Posted October 23, 2009 Report Posted October 23, 2009 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?
Val Posted October 23, 2009 Report Posted October 23, 2009 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...
FT3 Posted October 23, 2009 Author Report Posted October 23, 2009 (edited) pasties mana PhpMyAdmin tur ir UserId un es ari padomaju ka id iet no turienes ;/ Edited October 23, 2009 by FT3
rATRIJS Posted October 23, 2009 Report Posted October 23, 2009 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'"
FT3 Posted October 23, 2009 Author Report Posted October 23, 2009 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
Recommended Posts