Jump to content

RED X showing up


jiggens

Recommended Posts

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>

 

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.