jiggens Posted August 30, 2007 Share Posted August 30, 2007 Help, My php file upload works great on mozilla, but is not working correctly on Internet Explorer if i upload a image its getting to the server but on the webpage and i refresh my page its there, but when i delete the image it hold the the space on the page and and all is display is a red X. It uploads correctly and deletes but not until i refresh the page, will it disappear. <?php if(array_key_exists('deleteImage', $_POST)) { if ($_POST['deleteImage'] == "Delete Map") { unlink('/Inetpub/wwwroot/homes/html/images/browse/maps/'. $ID . '.jpg'); unlink('/Inetpub/wwwroot/homes/html/images/browse/maps/'. $ID . '-TH.jpg'); } elseif ($_POST['deleteImage'] == "Delete Logo") { unlink('/Inetpub/wwwroot/homes/html/images/browse/logos/'. $ID . '.jpg'); unlink('/Inetpub/wwwroot/homes/html/images/browse/logos/'. $ID . '-TH.jpg'); } elseif ($_POST['deleteImage'] == "Delete Features List") { $query = "SELECT * from psh_communities WHERE ID = $ID"; $result = mysql_query($query); $row = mysql_fetch_row ($result); $query = "UPDATE psh_communities SET features = 'NULL' WHERE ID = $ID"; $result = mysql_query($query); unlink('/Inetpub/wwwroot/homes/html/browse/features/'. $row[10]); } elseif ($_POST['deleteImage'] == "Delete Brochure") { $query = "SELECT * from psh_communities WHERE ID = $ID"; $result = mysql_query($query); $row = mysql_fetch_row ($result); $query = "UPDATE psh_communities SET brochure = 'NULL' WHERE ID = $ID"; $result = mysql_query($query); unlink('/Inetpub/wwwroot/homes/html/browse/brochures/'. $row[8]); } elseif ($_POST['deleteImage'] == "Delete Banner") { unlink('/Inetpub/wwwroot/homes/html/images/browse/banners/'. $ID . '.jpg'); } } ?> Source of Maps <td align="right" valign="top">Location/Map: </td> <td align="left" valign="top"><img src='http://homes.pacificscene.com/images/browse/maps/14.jpg' /><input type='submit' name='deleteImage' value='Delete Map' /><br /><input name='newMap' type='file' size='40' /><input type='submit' name='uploadNewMap' value='Upload' /></td> </tr> Quote Link to comment https://forums.phpfreaks.com/topic/67335-red-x-showing-up/ Share on other sites More sharing options...
Ninjakreborn Posted August 30, 2007 Share Posted August 30, 2007 If you are wanting instant results you are going to need to google, and study Ajax. Quote Link to comment https://forums.phpfreaks.com/topic/67335-red-x-showing-up/#findComment-337848 Share on other sites More sharing options...
jiggens Posted August 31, 2007 Author Share Posted August 31, 2007 Seems like my img src is sticking in there after deletion, so its deleting the file but not from the mysql database, is that correct? <td align="right" valign="top"><div align="right">Logo:</div></td> <td align="left" valign="top"><img src='http://homes.pacificscene.com/images/browse/logos/40.jpg' /><input type='submit' name='deleteImage' value='Delete Logo' /><input type="hidden" name="MAX_FILE_SIZE" value="30000" /><br /><input name='newLogo' type='file' size='40' /><input type='submit' name='uploadNewLogo' value='Upload' /></td> </tr> Quote Link to comment https://forums.phpfreaks.com/topic/67335-red-x-showing-up/#findComment-338568 Share on other sites More sharing options...
Ninjakreborn Posted August 31, 2007 Share Posted August 31, 2007 I am not sure how you setup your database. If the value in the database is one you are trying to clear out, in a set of rows. Then chances are you need a small piece of code where the images are pulled to show if ($row['imagefield'] != "") { echo 'Display Image Here"; } If you are actually trying to clear an entire record from the database where the image data is present, then it might not be deleting the field. Manually check the data to see if that image was removed, or next time you run the script echo out your delete statement for the db and paste the output here. Quote Link to comment https://forums.phpfreaks.com/topic/67335-red-x-showing-up/#findComment-338700 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.