supermerc Posted December 24, 2006 Share Posted December 24, 2006 Hey, I have this code that for users to upload images, it saves in a folder (userimage) under their username, How do i post it on their profile so it will work for every user? Link to comment https://forums.phpfreaks.com/topic/31775-posting-someones-pic/ Share on other sites More sharing options...
AndyB Posted December 24, 2006 Share Posted December 24, 2006 Straightforward solution to your hyper-vague question ... same as any other image you want to display:[code]echo "<img src='". $path_to_userimage_folder. "/". $whatever_the_pic_name_is. "'/>";[/code] Link to comment https://forums.phpfreaks.com/topic/31775-posting-someones-pic/#findComment-147370 Share on other sites More sharing options...
supermerc Posted December 24, 2006 Author Share Posted December 24, 2006 Its not workingThis is my code[code] <?php require("config.php"); require("func.php"); //echo some styles to spice it up... echo " <style> body { background: #EBEBEB; font-family: Verdana, Arial; font-weight: bold; font-size: 9px; color: #000000; } .register_box { border: 1px solid #323232; background: #202020; font-family: Verdana, Arial; font-weight: bold; font-size: 9px; color: #FFFFFF; } </style> "; // if the variable member_id has been set, or there is a value assigned to it... if(isset($_GET['member_id'])) { $member_id = (INT)$_GET['member_id']; $member_info = mysql_query("SELECT username, description, name, email FROM users WHERE activated = '1' AND id = '$member_id' LIMIT 1"); if(mysql_num_rows($member_info) > 0) { // we can go ahead and assign it to an array because this user exists $profile_info = mysql_fetch_assoc($member_info); echo " <h1>$profile_info[username]</h1> <br /> <br/> <b>Name: $profile_info[name] <br /> <b>Descriptions: $profile_info[description] <br /> <b>Email:</b> <a href='mailto:$profile_info[email]'>$profile_info[email]</a> <br /> <br /> "; } else { echo "That member does not exist, or is not activated yet!"; } } else { echo "There was no member ID to view a profile for!"; } ?> [/code]I want it to show up after <h1>$profile_info[username]</h1> because their username has to be on top. Link to comment https://forums.phpfreaks.com/topic/31775-posting-someones-pic/#findComment-147374 Share on other sites More sharing options...
legohead6 Posted December 25, 2006 Share Posted December 25, 2006 or dont even worry about folders.. just have an images folder, then have it insert the name of the pic into the database with there other info, then call on it and go <img src=../images/$filename>, that works for me Link to comment https://forums.phpfreaks.com/topic/31775-posting-someones-pic/#findComment-147467 Share on other sites More sharing options...
supermerc Posted December 25, 2006 Author Share Posted December 25, 2006 how do i insert it into database? Link to comment https://forums.phpfreaks.com/topic/31775-posting-someones-pic/#findComment-147516 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.