Problem displaying phpbb avatars outside of forum
Posted: Thu Mar 31, 2011 12:31 pm
Hey!
I have successfully integrated some of phpbb's functions with my website, such as the login system and a part of the user profiles.
The problem is, when I try displaying the avatars of the users, the avatar does not show up.
First of all, I checked, and the filename of the avatar in the database is different from the actual filename in the "forum/images/avatars/upload" directory.
Then, even when I manually tried to correct the filename (just to try it out) it gives me a 403 error.
How can I display the user avatar on my site successfully?
Here is my current code:
And later:
Thanks!
I have successfully integrated some of phpbb's functions with my website, such as the login system and a part of the user profiles.
The problem is, when I try displaying the avatars of the users, the avatar does not show up.
First of all, I checked, and the filename of the avatar in the database is different from the actual filename in the "forum/images/avatars/upload" directory.
Then, even when I manually tried to correct the filename (just to try it out) it gives me a 403 error.
How can I display the user avatar on my site successfully?
Here is my current code:
Code: Select all
<?php
$user = $_GET["user"];
$con = mysql_connect("localhost","***","***");
if (!$con) {die('Could not connect: ' . mysql_error());}
mysql_select_db("db_kitchentube", $con);
$result = mysql_query("SELECT * FROM phpbb_users WHERE username_clean = '$user'");Code: Select all
<img class="user" src="forum/images/avatars/upload/<?php echo $row['user_avatar'] ?>" width="90px" height="90px" alt="pic" /></a>