PHP Code not Displaying on page correctly

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

PHP Code not Displaying on page correctly

Post 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.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

You could always display it with a regular <img> tag.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Just for the record: continuation of viewtopic.php?p=398742
jiggens
Forum Commoner
Posts: 37
Joined: Sun Jul 08, 2007 4:49 pm

Post 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' />";
	}
Last edited by jiggens on Mon Jul 09, 2007 11:40 am, edited 1 time in total.
jiggens
Forum Commoner
Posts: 37
Joined: Sun Jul 08, 2007 4:49 pm

Post 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.
Post Reply