freakunleash Posted March 1, 2012 Share Posted March 1, 2012 I have a doubt that I’m doing something wrong in the below code but I’m not able to figure it out. As of now I’m getting the correct result which I’m expecting. Please check below code & let me know if there are any mistakes: <div class='imgs'><a href='movies.php?movieid=<?php echo $id;?>'><img src='<?php if(!empty($poster)){echo $poster;}else{echo $dft_img;}?>' width='214' height='314' alt='<?php echo $title;?>' </a></div> regards Bhaskar Quote Link to comment https://forums.phpfreaks.com/topic/258032-display-image/ Share on other sites More sharing options...
dragon_sa Posted March 1, 2012 Share Posted March 1, 2012 whats the actual problem? I am guessing its the image not displaying, if after checking your html output the paths look correct double check and make sure the images you are specifying in those variables actually exist in the same path on the server you are loading the script form. The syntax is fine except you have crammed it all together I would evaluate the variables earlier and then just echo the correct ones in place. Quote Link to comment https://forums.phpfreaks.com/topic/258032-display-image/#findComment-1322670 Share on other sites More sharing options...
ReeceSayer Posted March 1, 2012 Share Posted March 1, 2012 I had a similar problem. Mine was when uploading a document and checking the database to see if it existed. There doesn't look to be any problem in your code and you say "... I’m getting the correct result which I’m expecting..." Just ensure you're passing the variables properly and you shouldn't have an issue. Quote Link to comment https://forums.phpfreaks.com/topic/258032-display-image/#findComment-1322675 Share on other sites More sharing options...
freakunleash Posted March 1, 2012 Author Share Posted March 1, 2012 Thanks guys... actually im not any issue with the code but im having a doubt that im doing somthing wrong. Quote Link to comment https://forums.phpfreaks.com/topic/258032-display-image/#findComment-1322676 Share on other sites More sharing options...
litebearer Posted March 1, 2012 Share Posted March 1, 2012 Aside... By hard coding the image dimensions, your are either: A) presuming all the images are that size; or B) forcing a resize. If "B", unless the images are some "equal" proportion of the hard coded sizes, you will end up with distorted images. Quote Link to comment https://forums.phpfreaks.com/topic/258032-display-image/#findComment-1322714 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.