Jump to content

Recommended Posts

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

<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

 

Php code must echo things in order to cause them to be output to the browser.

 

<?php $image_path . "profile.jpg"; ?> outputs nothing (do a 'view source' in your browser to see what you are getting.)

 

<?php echo $image_path . "profile.jpg"; ?> will output whatever is in $image_path concatenated with "profile.jpg"

Then the path must be incorrect relative to the page that the code is on or the image by that exact name and letter-case (assuming you are on an operating system that is case sensitive) does not exist and the problem is not really a php problem anymore.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.