conan318 Posted April 26, 2011 Share Posted April 26, 2011 Echo "<img src='http://datenight.netne.net/images/".$info['img'] ."'title='.info['username']'"."' width='50' height='50'>"; im trying display the user's, username in the title when the mouse hovers over the img it displays the username of that image. no errors just displays .info as title thanks [/code] Quote Link to comment https://forums.phpfreaks.com/topic/234749-img-title/ Share on other sites More sharing options...
conan318 Posted April 26, 2011 Author Share Posted April 26, 2011 Echo "<img src='http://datenight.netne.net/images/".$info['img'] ."'title='.$info['username']'"."' width='50' height='50'>"; just noticed i left the $ out but now getting Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/a7817347/public_html/login_success.php on line 67 Quote Link to comment https://forums.phpfreaks.com/topic/234749-img-title/#findComment-1206353 Share on other sites More sharing options...
Yucky Posted April 26, 2011 Share Posted April 26, 2011 Fix: echo "<img src='http://datenight.netne.net/images/".$info['img']."' title='".$info['username']."' width='50' height='50'>"; Quote Link to comment https://forums.phpfreaks.com/topic/234749-img-title/#findComment-1206356 Share on other sites More sharing options...
Barand Posted April 26, 2011 Share Posted April 26, 2011 ... or as a single unconcatenated string echo "<img src='http://datenight.netne.net/images/{$info['img']}' title='{$info['username']}' width='50' height='50'>"; Quote Link to comment https://forums.phpfreaks.com/topic/234749-img-title/#findComment-1206358 Share on other sites More sharing options...
conan318 Posted April 26, 2011 Author Share Posted April 26, 2011 thanks worked fine still getting my head around the correct syntax Quote Link to comment https://forums.phpfreaks.com/topic/234749-img-title/#findComment-1206360 Share on other sites More sharing options...
conan318 Posted April 26, 2011 Author Share Posted April 26, 2011 its working fine, the query is displaying 20 random records is there a way to force the images display vertical across the page instead of horizontal down the page. i tryed setting a height to the div class in css but that didit work cheers Quote Link to comment https://forums.phpfreaks.com/topic/234749-img-title/#findComment-1206366 Share on other sites More sharing options...
PHPSuperNewb Posted April 26, 2011 Share Posted April 26, 2011 this is a css related issue right? try to make your div like this: float:left; height:high enough for the multiple images px; width:max width of the biggest image px; //not sure about this one, what if 2 pics are big enough to fit in the biggest one. That would mean there will be 2 pics horizontal and the rest vertical. Quote Link to comment https://forums.phpfreaks.com/topic/234749-img-title/#findComment-1206369 Share on other sites More sharing options...
conan318 Posted April 26, 2011 Author Share Posted April 26, 2011 all the picture are scaled down to 50px by 50px so there all the same. .random_user{ width: 1000px; height: 50px; float:left; } but still displaying vertical Quote Link to comment https://forums.phpfreaks.com/topic/234749-img-title/#findComment-1206375 Share on other sites More sharing options...
PHPSuperNewb Posted April 26, 2011 Share Posted April 26, 2011 all the picture are scaled down to 50px by 50px so there all the same. .random_user{ width: 1000px; height: 50px; float:left; } but still displaying vertical set the width to 50 and the height to 1000, see if that helps. EDIT: uh wait isn't this what you wanted :S? is there a way to force the images display vertical across the page instead of horizontal down the page. Quote Link to comment https://forums.phpfreaks.com/topic/234749-img-title/#findComment-1206376 Share on other sites More sharing options...
conan318 Posted April 26, 2011 Author Share Posted April 26, 2011 no luck there php seems to create a new div tag for each and placing on top of each other for some reason Quote Link to comment https://forums.phpfreaks.com/topic/234749-img-title/#findComment-1206377 Share on other sites More sharing options...
PHPSuperNewb Posted April 26, 2011 Share Posted April 26, 2011 so, theres a div tag for each image? then make a div that contains the newly created divs, give the main div a float:left; and make sure all the newly created divs are width:50px; and height:50px; then let the main div have a longer height and a 50px width. I guess your using a loop of some kind to echo the picture divs? create an echo of the main div outisde the loop and make it end after the loop has finished then. this should put all the picture divs inside the main div and would be showed vertical. can I maybe see the loop your using to create the images? I don't quite get what your doing :S Quote Link to comment https://forums.phpfreaks.com/topic/234749-img-title/#findComment-1206378 Share on other sites More sharing options...
conan318 Posted April 26, 2011 Author Share Posted April 26, 2011 cheers buddy all sorted now. neat little trick that one Quote Link to comment https://forums.phpfreaks.com/topic/234749-img-title/#findComment-1206385 Share on other sites More sharing options...
PHPSuperNewb Posted April 26, 2011 Share Posted April 26, 2011 cheers buddy all sorted now. neat little trick that one no problem, glad to be of your assistance Quote Link to comment https://forums.phpfreaks.com/topic/234749-img-title/#findComment-1206386 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.