garydt Posted June 27, 2007 Share Posted June 27, 2007 I've just uploaded a website that lets people upload photos. I've been testing it and the photos aren't appearing on the webpages after i've uploaded them. Yet they are going into the folders. why would this be? Thanks. Link to comment https://forums.phpfreaks.com/topic/57427-photos-not-appearing/ Share on other sites More sharing options...
bbaker Posted June 27, 2007 Share Posted June 27, 2007 maybe the path to the folder isn't correct with the img tags? Link to comment https://forums.phpfreaks.com/topic/57427-photos-not-appearing/#findComment-284118 Share on other sites More sharing options...
papaface Posted June 27, 2007 Share Posted June 27, 2007 Code is lovely you know. People cant help if they dont see what code your using. Link to comment https://forums.phpfreaks.com/topic/57427-photos-not-appearing/#findComment-284129 Share on other sites More sharing options...
garydt Posted June 27, 2007 Author Share Posted June 27, 2007 $big = $row_Recordset2['bigimagename']; <a href="editphoto.php"><img src="<?php print $big;?>" border="0" align="top" /></a></td> The photo is displayed on webpage when i try it locally but not on the remote server. I've created the same folders on the remote servers that i have locally so paths should be the same. Heres what in the $row_Recordset2['bigimagename'] field- ./thumbnails/P6040019.JPG Link to comment https://forums.phpfreaks.com/topic/57427-photos-not-appearing/#findComment-284164 Share on other sites More sharing options...
garydt Posted June 28, 2007 Author Share Posted June 28, 2007 I'm still struggling. Any ideas? Link to comment https://forums.phpfreaks.com/topic/57427-photos-not-appearing/#findComment-284725 Share on other sites More sharing options...
phpknight Posted June 28, 2007 Share Posted June 28, 2007 Can you paste a link with the path to the script, and also a path to the image which should show up? Link to comment https://forums.phpfreaks.com/topic/57427-photos-not-appearing/#findComment-284745 Share on other sites More sharing options...
HuggieBear Posted June 28, 2007 Share Posted June 28, 2007 Also, when the page is rendered, right click it and look at the source. Does the path to the image look correct there? Regards Huggie Link to comment https://forums.phpfreaks.com/topic/57427-photos-not-appearing/#findComment-284747 Share on other sites More sharing options...
suma237 Posted June 28, 2007 Share Posted June 28, 2007 post the code in the page edit.php Link to comment https://forums.phpfreaks.com/topic/57427-photos-not-appearing/#findComment-284779 Share on other sites More sharing options...
garydt Posted June 28, 2007 Author Share Posted June 28, 2007 This is the path to the image when i right click on where the image should be- http://www.elvis-people.com/smallpics/P6040012.JPG The path is right although in the database it is stored aas '.smallpics/P6040012.JPG' is this right? Script for uploading the photo- $uploadsDirectory = './uploads/'; $uploadFilename = $uploadsDirectory.$fieldname['name']; move_uploaded_file($fieldname['tmp_name'], $uploadFilename); resizeimage($fieldname['name']); $smallimage = './thumbnails/'.$_FILES['file']['name']; resizelarger($fieldname['name']); $smallpics = './smallpics/'.$_FILES['file']['name']; unlink($uploadFilename); mysql_select_db($database_elvisdb, $elvisdb); $insertSQL = sprintf("INSERT INTO images (imageName, bigimagename, usnm, bigcaption) VALUES ('$smallimage', '$smallpics', '$user', %s)", script for displaying photo $big = $row_Recordset2['bigimagename']; <td valign="top" aliign="CENTER"> <a href="editphoto.php"><img src="<?php print $big;?>" border="0" align="top" /></a></td> [code] It works locally but not on the server. hope i've given the right information you asked for. [/code] Link to comment https://forums.phpfreaks.com/topic/57427-photos-not-appearing/#findComment-284791 Share on other sites More sharing options...
garydt Posted June 28, 2007 Author Share Posted June 28, 2007 phpknight - what do you mean by - link with the path to the script. Thanks Link to comment https://forums.phpfreaks.com/topic/57427-photos-not-appearing/#findComment-284794 Share on other sites More sharing options...
suma237 Posted June 28, 2007 Share Posted June 28, 2007 try this $big = $row_Recordset2['bigimagename']; <td valign="top" aliign="CENTER"> <a href="editphoto.php?id=<?=$big?>">click here to view</a></td> edit.php $id1=$_REQUEST['id']; <img src="<?=id1?>" border="0" align="top" /> Link to comment https://forums.phpfreaks.com/topic/57427-photos-not-appearing/#findComment-284797 Share on other sites More sharing options...
garydt Posted June 28, 2007 Author Share Posted June 28, 2007 Thanks but i don't think that will work because i need the photo to appear straightaway. Link to comment https://forums.phpfreaks.com/topic/57427-photos-not-appearing/#findComment-284819 Share on other sites More sharing options...
garydt Posted June 28, 2007 Author Share Posted June 28, 2007 Any more suggestions? Link to comment https://forums.phpfreaks.com/topic/57427-photos-not-appearing/#findComment-284861 Share on other sites More sharing options...
garydt Posted June 28, 2007 Author Share Posted June 28, 2007 i tried that suggestion and the photo still isn't appearing. What can i try next? Link to comment https://forums.phpfreaks.com/topic/57427-photos-not-appearing/#findComment-284923 Share on other sites More sharing options...
phpknight Posted June 28, 2007 Share Posted June 28, 2007 So, are you saying the image gets to the server but won't display, or that you cannot get it there? I ask this because when I clicked on that JPG link, I got an e404. I threw a test blue square up there. Where it says to click on the image to edit, the IMG tag is just "". Let me know if I am in the wrong place. Link to comment https://forums.phpfreaks.com/topic/57427-photos-not-appearing/#findComment-285145 Share on other sites More sharing options...
garydt Posted June 29, 2007 Author Share Posted June 29, 2007 Thanks alot I've managed to crack it. I had set the permissions for the photos folders to read/write/execute for everyone and now the photos are appearing. Is that ok, security-wise? Link to comment https://forums.phpfreaks.com/topic/57427-photos-not-appearing/#findComment-285726 Share on other sites More sharing options...
phpknight Posted June 29, 2007 Share Posted June 29, 2007 Gary, Probably not. If you have your own server, you should be able to run php with suexec and do that with fewer permissions. I had to do the same thing when I was on a shared server. Link to comment https://forums.phpfreaks.com/topic/57427-photos-not-appearing/#findComment-286215 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.