So I am trying to get the photo from the database whenever the user uploaded one. But in my case, even though the user didn't upload a photo nor do not have a a photo saved in the database, a broken image still shows up. I do not know what's wrong with my code but I hope you guys can help me.
Here's my php code:
$img = ['photo'];
if($img != "") {
$photo = '/zchs_alumni/news/'.$img;
echo "<img name='$photo' src='$photo' width='750' height='300' alt='img1'/>";
}
Any help?
Aucun commentaire:
Enregistrer un commentaire