Ineternet Explorer RED X CURSE

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jiggens
Forum Commoner
Posts: 37
Joined: Sun Jul 08, 2007 4:49 pm

Ineternet Explorer RED X CURSE

Post by jiggens »

Cant seem to get rid of the red X and its still holding onto the img src file cause havoc when you try to delete image from page. Any suggestions?



Any other code that you may need please let me know and i will post, Thanks for your help!!!



Code: Select all

<?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');
                  }

      }
?>


Any other code that you may need please let me know and i will post, Thanks for your help!!!
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

There's no code in what you posted that would display an image, so that code can't be displaying a missing image icon.
jiggens
Forum Commoner
Posts: 37
Joined: Sun Jul 08, 2007 4:49 pm

Post by jiggens »

Upload Code

Code: Select all

<?php

if(array_key_exists('uploadNewLogo', $_POST)) {
		if ($ID != "" && $ID != "new") {
				move_uploaded_file($_FILES['newLogo']['tmp_name'], $uploadfile2);
				createImage($uploadfile2,100,400,'homes/html/images/browse/logos/' . $ID . '.jpg');
				createImage($uploadfile2,100,160,'homes/html/images/browse/logos/' . $ID . '-TH.jpg');
				unlink($uploadfile2);
		}
}
?>
jiggens
Forum Commoner
Posts: 37
Joined: Sun Jul 08, 2007 4:49 pm

Form

Post by jiggens »

Code: Select all

<?
						
						if ($ID != "" && $ID != "new") { 
						 if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/homes/html/images/browse/logos/" . $ID . ".jpg")); {
							
							print "<img src='http://homes.pacificscene.com/images/browse/logos/" . $ID . ".jpg' />"; 
							print "<input type='submit' name='deleteImage' value='Delete Logo' />";
						    print "<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"30000\" />";
							print "<br />";
						}
							print "<input name='newLogo' type='file' size='40' /><input type='submit' name='uploadNewLogo'  value='Upload' />";
						}
					
					?>
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

Well, there's images in http://homes.pacificscene.com/images/browse/logos/ .. so if you're referencing one of them I don't see why it won't work. If you right click the missing image icon and check it's location is it one of the images in that folder?
jiggens
Forum Commoner
Posts: 37
Joined: Sun Jul 08, 2007 4:49 pm

Post by jiggens »

I dont think you understand what my problem really is. The problem i am having is when go and submit my image for deletion, its keeping a cached image in its place. Its not deleting from the webpage, but the image is deleting from the server.
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Post by Zoxive »

jiggens wrote:I dont think you understand what my problem really is. The problem i am having is when go and submit my image for deletion, its keeping a cached image in its place. Its not deleting from the webpage, but the image is deleting from the server.
Might help if you tell us the problem in the first place :lol:

And Its deleting from the server but not deleting from the webpage? What does that mean?

Press CTRL+F5 your BROWSER might be caching the images.
jiggens
Forum Commoner
Posts: 37
Joined: Sun Jul 08, 2007 4:49 pm

The Problem

Post by jiggens »

I didn't say webspace, what i said is webpage.


Problem:

I upload a image and it shows up fine, i can see it and its viewable.

When i go to delete it, i submit to delete and the image doesn't go away, in its place after i press ctrl+F5 there is no image there anymore it was deleted from the server, but still holds the place of the image with a Red X in Internet Explorer.

Sorry i wasn't more clear everyone.


When you view the source of the file its still holding the img src tag, but it shouldn't be, i am using the same code on another webpage and when i delete it it works, doesn't create a red x and removes the img source tag for the image.

This site is being transferred from Unix to Windows hosting for what reason i really don't know but this is what my company wants.
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Post by Zoxive »

.. So it deletes fine its just that it still is trying to link to the image in the HTML code? So IE is displaying an X saying no image found.

So your problem is either just remove the <img> tags manually, or change the code that makes them to check and see if the image exists, and then create the <img> tags or not.
jiggens
Forum Commoner
Posts: 37
Joined: Sun Jul 08, 2007 4:49 pm

Post by jiggens »

yeah i guess thats what i want to do, im still learning php, so i am not 100% sure on where to go from here???
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Post by Zoxive »

Look at the code of the page that has the broken images and find where it is creating the img tags.
Post Reply