This is my latest shortened version of the homepage in my reg-login site PHP.
When you login to your account, your homepage welcomes you with your first & surname.
Then it is supposed to show you your bio ($row "bio" in tbl) and show you an url in an iframe ($row "your website" in tbl).
Problem is, the iframe is not showing the data (url) that is in the "your website" in tbl.
I tried escaping, switching to a single quote from double but no luck.
What do you think is wrong?
$user Home Page
/*Check if user is logged-in or not by checking if session is set or not.
If user is not logged-in then redirect to login page. Else, show user's account homepage.php.*/
$user = $_SESSION["user"];
$sql = "SELECT * FROM users WHERE Username = '".$user."'";
$result = $conn->query($sql);
while($row = $result->fetch_assoc())
$db_id = $row["Id"];
$db_username = $row["Username"];
$db_forename = $row["Forename"];
$db_surname = $row["Surname"];
$db_email = $row["Email"];
$db_bio = $row["Bio"];
$db_your_fav_url = $row["Fav_Url"];
//Welcome user by name.
echo "<center>Welcome <b><h2>$db_forename $db_surname!</center>"?></h2></b>|
//Display log-out link.
echo "<p align='right'><a href='logout.php'>$user Log Out</a>";?>|</p><br>
//Display User Bio.
//Display User's Fav Url in iFrame.?>
The "Bio" column shows no data on the page even though the column contains data in the db.
I get error:
[16-Mar-2017 15:29:44 UTC] PHP Notice: Undefined index: Your_Fav_Url in /home/sn/public_html/sn/home.php on line 34