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. Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
garydt Posted June 28, 2007 Author Share Posted June 28, 2007 I'm still struggling. Any ideas? Quote Link to comment 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? Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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] Quote Link to comment 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 Quote Link to comment 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" /> Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
garydt Posted June 28, 2007 Author Share Posted June 28, 2007 Any more suggestions? Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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.