Hey everyone i have made a login script using php which is working fine,
but now i have got this
<?php
//INCLUDE THE CONFIGURATION SCRIPT
include("config.php");
$username = $_SESSION['username'];
//CONNECT TO DATABASE
$db = mysql_connect($db_host,$db_user,$db_pass);
mysql_select_db ($db_name) or die ("Cannot connect to database");
//SET QUERY
$query = "SELECT * FROM core_users WHERE username=$username";
#or: $query = "SELECT * FROM cats WHERE info LIKE '%$abrv%'";
#this depends on your database structure
//EXECUTE QUERY
$result = mysql_query($query);
//SHOW QUERY RESULTS
while($r=mysql_fetch_array($result))
{
$id=$r["id"];
$username=$r["username"];
$password=$r["password"];
$first_name=$r["first_name"];
$last_name=$r["last_name"];
$email=$r["email"];
$domain=$r["domain"];
$package=$r["package"];
echo "<font face='Verdana' size='1'><b>Package Information:<br>
</b>Package: $package<br>
Domain: $domain</font><p><font face='Verdana' size='1'><b>Personal
Information:<br>
</b>First Name: $first_name<br>
Last Name: $last_name<br>
Email: $email</font></p>
<p><font face='Verdana' size='1'><b>Account Information:<br>
</b>Username: $username<br>
Password: <<hidden>></font><p><font face='Verdana' size='1'>
<b>Notices:<br>
</b>If any of the information above is incorrect please email our
support team at <a href='mailto:support@ehostbox.com'>
[email]support@ehostbox.com[/email]</a> immediately so that we can change the account
information to prevent you being re-billed or possibly suspended.</font>";
}
//CLOSE DATABASE CONNECTION
mysql_close($db);
?>
i am trying to display a users information via a php script from the database (but it must only work for the username that is currently logged in hence the (WHERE username=$username) so that hopefully it would work.
You can view what i have done so far http://www.nominet.biz/client_info.php it doesnt seem to be working at all yet, if you know how todo this can you please post a working code (not just tell me what todo because i am kinda dumb at seek'n'repair.
Thanks anyone who does it is entitled to a free hosting package @ www.eHostBox.com