atchy Posted December 28, 2006 Share Posted December 28, 2006 Hi All,I am using, document.getElement by id, to load large version of a thumbnail image on click. The data in the MySQL table as follows: <img src=images_large/r_price_lg1b.jpg> This has served me well when using ASP now into PHP and the only way I can get this to work is to put the full url of the image into the database ie img src=http://www.mysite.com/images_large/name_lg1b.jpg for every image. Is there an easier way? The thumbnails use <img src=images_small/r_price_sm1b.jpg title='Richard Price - Heaven and Earth'> and work ok so its something to do with the document.getElement by id. Any clues!ThanksAtchy Quote Link to comment Share on other sites More sharing options...
johnbr Posted December 28, 2006 Share Posted December 28, 2006 Unfortunately, I do not have any answer for this, but I do have a similar question. I created a form to upload documents and images to a Mysql table. The files appear to upload properly, but when I attempt to display them in a web page, only the file name is displayed ie. "image.jpg", but not the actual document or image. I have used the img src tag plus the variable that returns the document name. I would appreciate guidance as to how to have images called from a Mysql db displayed on a web page. Since I am new to this forum, I am not sure if this is the way to submit this question, or if starting another topic would have been more appropriate. Guidance with that would also be appreciated. Thanks. Quote Link to comment Share on other sites More sharing options...
atchy Posted December 28, 2006 Author Share Posted December 28, 2006 Hi Johnbr,My method has been to upload the .jpg files using ftp to an images folder and then use the database to create the link. I have noticed that the file name should be enclosed within <>Atchy Quote Link to comment Share on other sites More sharing options...
johnbr Posted December 28, 2006 Share Posted December 28, 2006 Atchy,Thank you for your quick response. I am using this with a web-enabled database where users are recording anecdotes in a text field and then have the opportunity to upload a document or graphic as an artifact. I don't really want to provide FTP access to all of the users. Your suggestion leads me think that I should use PHP to move the file to the my web folders rather than the database. I am not sure how to do that, but I believe that it is possible. I do know how to use the database to link to other resources, as I have done that in the past. If you, or anyone else, has other suggestions, I would appreciate hearing them. Thanks.John Quote Link to comment Share on other sites More sharing options...
fenway Posted December 30, 2006 Share Posted December 30, 2006 Have your PHP script write the file to the server, then store the path to that file in the DB, and serve it on the way out. 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.