J. Mar J. Mar - 1 month ago 7
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:

<tr>
<td>Email Address:</td>
<td><input type='text' name='textead' value="<?php echo $st_row['emailAddress'] ?>"/></td>
</tr>
<tr>
<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>
</tr>
<tr>
<td></td>
<td><input type='submit' name='btnsave' value='SAVE'></td>
<td><input type='submit' name='back' value='CANCEL'></td>
</tr>

Answer

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..).

Comments