what am i doing wrong in the img src?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
barrowvian
Forum Commoner
Posts: 47
Joined: Tue Aug 19, 2008 3:49 pm

what am i doing wrong in the img src?

Post by barrowvian »

I am wanting to dynamically display an image. So far I have got;

Code: Select all

<img style="border: 1px black solid" alt="Photo gallery" src="<?php $image_path . "profile.jpg"; ?>" id="tempGallery" width="160" height="160">
with $image_path being the directory which is called from a cookie. I could not include profile.jpg within the cookie as I use that for other parts of the site. All Im wanting to do is display the profile image, but I do need the $image_path in there also. Thanks
mikosiko
Forum Regular
Posts: 757
Joined: Wed Jan 13, 2010 7:22 pm

Re: what am i doing wrong in the img src?

Post by mikosiko »

Code: Select all

<?php $image_path . "profile.jpg"; ?>
maybe you need just and echo? like

Code: Select all

<?php echo $image_path . "profile.jpg"; ?>
Miko
Post Reply