J. Mar J. Mar - 1 month ago 8
CSS Question

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

<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='textpic' value="<?php echo $st_row['picture'] ?>" height="100" width="100"/></td>
/* this is the problem it cant display image and update it and then save */


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