J. Mar J. Mar - 2 years ago 67
HTML Question

Why is it i can't display image? i been trying so many different codes but the image still doesn't display

Why is it i can't display even update image and save it?

I have the following code:

<td>Email Address:</td>
<td><input type='text' name='textead' value="<?php echo $st_row['emailAddress'] ?>"/></td>
<td>Profile Picture:</td>
<td><img src="<?php echo $st_row['picture'] ?>" height="100" width="100"/></td>
/* this is the problem it cant display image */

<td><input type="file" name="textpic" accept="image/*" /></td>
<td><input type='submit' name='btnsave' value='SAVE'></td>
<td><input type='submit' name='back' value='CANCEL'></td>

Answer Source

IMG tag should use this format :

<img src="<?php echo $st_row['picture'] ?>" alt="" />

But $st_row['picture'] should represent a path to the picture after you handled the upload (which means using the PHP code to save the uploaded file on your server).

If this answer is insufficient, please provide more details (like the PHP code..).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download