Jump to content

session help


Kayz

Recommended Posts

Ok i am having a problem with the sessions been working on it for a good 4 hours still no luck.

 

Ok the code below connects to the database fine,

 

<?php
session_start();

$connect = mysql_connect("*******ac.uk","******","******");

mysql_select_db("mdb_*****", $connect);

$date = date("Y-m-d");

$query = "SELECT * contacts
values('$firstname', '$surname', '$email', '$contact_no', '$housename_no', '$address_line1', '$address_line2', '$address_line3','$city_county','$postcode','$username', '$password', '$date')";

mysql_query ($query, $connect);
?>

 

Later on in the page a bit further down once the user logs in i want to show his/her username. So this is what i have done:

 

<strong>Welcome</strong>
<?php
echo $username
?>

 

This works perfectly fine showing the username that has logged in, but then ive tried to call up many other details about that particular user but no luck. Ive tried echo $email etc.

 

But the funny thing is if i try echo $username or echo $password it will show also if i try echo $date that shows also, only these 3 things show nothing else.

 

What can i do? I just want to show that user his/her own details that is stored in the MySQL db.

Link to comment
https://forums.phpfreaks.com/topic/46037-session-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.