twilitegxa Posted June 12, 2011 Share Posted June 12, 2011 I am having an issue displaying my images that I have uploaded to my server. I have just changed the way in which the files are uploaded to my server (which now includes uploading two files on one form instead of just one), but I can't imagine how that would affect the way in which I display the images, because they are being saved into the same folder on my server, and I have double checked and the images are actually saving in the folder, as well as the path to the images are saving to the database (everything looks like it is right anyway). So, my problem somehow lies in how I am trying to display the images I guess. Here is a link to the page to view for an example: http://midwestcreativeconsulting.com/jhrevell/collections/ If you click on one of the images, the first one (which you can actually see) is apparently working, while the second one you cannot see, but it appears to have saved correctly. Here is my script for displaying the images: <div class="contentleft"> <div class="toptitle">Collections<> <div class="topsubtitle"> <h3 class="padding">Click on an image to view details about the piece of jewelry:</h3> <?php $dbhost = 'localhost'; $dbuser = 'username'; $dbpass = 'password'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); $dbname = 'database'; mysql_select_db($dbname); $all_records = "SELECT * FROM gallery"; $all_records_res = mysql_query($all_records); $num_rows = mysql_num_rows($all_records_res); echo "<div id='extra-padding'>"; if ($num_rows == '0') { echo "<p class='empty'>No jewelry exists. Please <a href='http://midwestcreativeconsulting.com/jhrevell/add'>add</a> some.</p>"; } else { while($image=mysql_fetch_array($all_records_res)){ echo "<div class='padding'><a href='http://midwestcreativeconsulting.com/jhrevell/view/?id=" .$image['id']. "'><img src='http://midwestcreativeconsulting.com/jhrevell/wp-content/themes/twentyten_3/upload/" .$image['image']. "' width='133' height='86' /><></a>"; } } echo "<>"; ?> <> <> So, it works for the first image, why not the second one? I can't understand what I am doing differently. Can anyone please help? Quote Link to comment https://forums.phpfreaks.com/topic/239156-images-not-displaying-from-folder-on-server/ Share on other sites More sharing options...
xyph Posted June 12, 2011 Share Posted June 12, 2011 There's a space in your image script. http://midwestcreativeconsulting.com/jhrevell/wp-content/themes/twentyten_3/upload/%20figureA.jpg It doesn't look like there's a space in your display script, so for some reason that space is being added when you're inserting the file name into the database. Quote Link to comment https://forums.phpfreaks.com/topic/239156-images-not-displaying-from-folder-on-server/#findComment-1228745 Share on other sites More sharing options...
twilitegxa Posted June 12, 2011 Author Share Posted June 12, 2011 Thank you soooooooo much! I was pulling out my hair wondering what i did wrong!!!! Thank you very much! Quote Link to comment https://forums.phpfreaks.com/topic/239156-images-not-displaying-from-folder-on-server/#findComment-1228751 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.