0

how to set avatar to my profile page .anyone help me for set my avatar image path in my profile page.

<?php
     
		require 'connect.php';
		$userg = mysql_query("SELECT avatar FROM members") or die("Failed to fetch your details.");
		 
		if (isset($_SESSION['MM_Username']))
		{
			echo "Welcome ".$_SESSION['MM_Username'];
			echo "<img src=".mysql_result($userg,0,"avatar" )." width=200 height=200>";
     	}
    ?>
4
Contributors
5
Replies
7
Views
6 Years
Discussion Span
Last Post by ko ko
0

Cant you just echo out the path, where your image is kept? Instead of taking it from the DB?

0

What is the problem with the above code?

i want to set avatar to my profile page i don't no how to set path.

0

Where your images are storing ? Are they same root of that PHP file ? If not, put the absolute path or relative path like below:

echo "<img src=\"http://yoursite.com/images/avatar/".mysql_result($userg,0,"avatar" )." width=\"200\" height=\"200\">";

By the way, don't post many thread with the same case.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.