Forums

PHP

This topic is locked

image upload. image wont show.

Posted 15 Jul 2004 20:39:38
1
has voted
15 Jul 2004 20:39:38 Chase Rage posted:
im building a user management system with php/mysql, where people can regiester, and fill out a profile, and i set up the option, to upload a user avatar, to their profile.

The image uploaded to the directory and the mysql table successfully. but when i put something like

<pre id=code><font face=courier size=2 id=code> &lt;*img src="a/userimages/&lt;*php echo $_SESSION['photo']; *&gt;" /&gt;</font id=code></pre id=code>

to display the image in the profile, it dosent show. just a red x, or when i go directly to the img url such as www.domain.net/a/userimages/image.jpg it dosent show, but when i connect to my ftp and download the image, it shows perfectly. now i have all the sessions registered fine, and everything else works so far, but it will not show the image at all, when i go to view source, it just says <pre id=code><font face=courier size=2 id=code> &lt;*img src="a/userimages/ *&gt;</font id=code></pre id=code>
and dose not display the image name.

Replies

Replied 21 Jul 2004 18:54:44
21 Jul 2004 18:54:44 Leesa Lavigne replied:
Not sure about your situation but I am always running into this type of problem with my different scripts. This might help you trouble shoot the problem.

In the browser, where you see the red - X:
Right click on it and view the properties.

What is the image that IT IS looking for? Sometimes in my query code, it does not include the .jpg extension or something.

Lots of times I will upload two images, example: photoLG.jpg and photoSM.jpg and I will draw the name in the query as just the photo and add the LG.jpg or SM.jpg manually in the query to pull the right one. If I don't code it correctly the browser is just looking for photo.

The following is an ASP script (just because I have it handy) but the same would apply to PHP. My code would look like this:
&lt;img src="UploadImages/&lt;%=(rsDetails.Fields.Item("Photo".value)%&gt;Lg.jpg" alt="large photo" hspace="10" vspace="10"&gt;

Hope that helps. Leesa

Edited by - Leesa Lavigne on 21 Jul 2004 18:58:08

Reply to this topic