beermaker74 Posted January 22, 2007 Share Posted January 22, 2007 hello I hope that I have an easy question. I have a page that allows images and captions to be uploaded. The images get uploaded and the image names get inserted into my database. It then transfers them to a display page. On this page you can see the images you just uploaded plus the captions. I have set up the page to let users update the captions and images. This is where my problem is. I have the images being dynamically displayed, Then I have the image upload file field just below the image. Plus the caption field below that. I have 5 image fields. So if I browse and upload on one of the file fields, it sets all the other images to blank. So if the user wants to update any of the images, they have to update all of them or it doesnt work. So I thought I could just set the file fields data binded to the url I have in the recordset. So if they only change one photo field then that would be the only one that changes. I inserted the value from the bindings panel in design view in dreamweaver. It looks like it is set but it doesnt seem to work. Here is an example of the file field code <label for="image2">File 2:</label> <input name="image[]" type="file" id="image2" value="<?php echo $row_Recordset1['photo2url']; ?>" />So if there is any way to set this value it would make my life a whole lot better. If this is not the way I should go about this task. Then please let me know. MY main goal is to let the user manage photos for a real estate listing that are stored in a folder unique to that listing. thanks Quote Link to comment Share on other sites More sharing options...
TEENFRONT Posted January 22, 2007 Share Posted January 22, 2007 i just read that and must have missed your point...what do you want to do? Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 22, 2007 Share Posted January 22, 2007 http://www.blooberry.com/indexdot/html/tagpages/i/inputfile.htm- Down at the very bottom it explains why this doesn't work in IE.Basically, you can't set the value="" of an input type="file" Quote Link to comment Share on other sites More sharing options...
beermaker74 Posted January 22, 2007 Author Share Posted January 22, 2007 so if I cant set the value dynamically. How should I go about doing this. I just want the user to be able to change images they have just uploaded. I need this value inserted into my database. I can probably display the contents of the folder. But how would I go about allowing them to delete photos and add new ones. Once again I need to keep track of the images so I can add captions and later display them in a slideshow. Im open to anything. thanks Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 22, 2007 Share Posted January 22, 2007 Instead of trying to set the value, just print it before the input box. That addresses that problem. Quote Link to comment Share on other sites More sharing options...
beermaker74 Posted January 22, 2007 Author Share Posted January 22, 2007 without going into the complexities ofthe script. I dont think displaying the value is going to help me at all. I appreciate your help though.so this is what I am trying to do. I have set up a variable above my sql update statement. I am then going to insert this variable into my statement. What I want to do is write an if else statement to test if the image file field has any data in it. ie they browsed to a new image and want to change the one they have. So if (file field 1 is blank) then $photo1url = my recordset photo1url. else $photo1url = $_FILES['image']['name']['1']; Does this make sense? AmI creating too much work for myself. Forgive me if I am going about this issue in a convoluted way. I am stiil learning phpthanks Quote Link to comment Share on other sites More sharing options...
beermaker74 Posted January 22, 2007 Author Share Posted January 22, 2007 i was able to set the input above the update statement withif (!$_FILES['image']['tmp_name'][0]){$photourl1 = $row_Recordset1['photo1url'];}else {$photourl1 = $_FILES['image']['name']['0'];}hopes this helps it might not be the best way but it works. if anybody else has any ideas i'll gladly try themthanks 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.