Page 1 of 1

PHP Code not Displaying on page correctly

Posted: Mon Jul 09, 2007 10:26 am
by jiggens
I am trying to get some php code to work correctly. What i want to do is have my uploaded files display after its uploaded under its proper title, does someone know what i could be doing wrong

Its PHP 5 with MySQL 5 in Windows IIS 6.0

Code: Select all

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);
            }
      }
The file is there and uploaded but not displaying correctly maybe i know if i remove the if statements out it i will appear but i don't want to do that.

Posted: Mon Jul 09, 2007 10:33 am
by superdezign
You could always display it with a regular <img> tag.

Posted: Mon Jul 09, 2007 10:50 am
by volka
Just for the record: continuation of viewtopic.php?p=398742

Posted: Mon Jul 09, 2007 10:55 am
by jiggens
Actually i need to have them not appear if they don't exist for example

Code: Select all

if ($ID != "" && $ID != "new") { 
	if (file_exists("/homes/html/images/browse/maps/" . $ID . ".jpg")) {
	print "<img src='http://homes.pacificscene.com/images/browse/maps/" . $ID . ".jpg' />"; 
	print "<input type='submit' name='deleteImage' value='Delete Map' />";
	print "<br />";
	}
	print "<input name='newMap' type='file' size='40' /><input type='submit' name='uploadNewMap' value='Upload' />";
	}

Posted: Mon Jul 09, 2007 11:04 am
by jiggens
I want it to appear when i have a file uploaded to the page, otherwise if i remove the

Code: Select all

if (file_exists("/homes/html/images/browse/maps/" . $ID . ".jpg"))

i will get also see the delete button always and it looks crowded on the page, i know this code will work, i am just missing something.

Yesterdays issue is resolved, i figure if i get one of these files figured out i can go fix the rest.


Appreciate the help.