Jump to content

Problem with PHP Include. Outputs a "?".


johnfoster

Recommended Posts

Ok I'm having an issue with a simple PHP Inlcude that I've never ran in to before. Maybe you guys can help.

I'm trying to include a picture simply titled 'promo1.jpg'.. I go about the normal PHP include way with this code:

<?php include $_SERVER['DOCUMENT_ROOT'] . '/images/promo1.jpg'; ?>

This proceeds to only output a question mark '?'. No error message. Nothing else. Just the server saying "What the hell?". I've tried not doing the DOCUMENT_ROOT route and tried more locally but still same '?'. Any ideas on this one? Any help is appreciated, thanks.

Link to comment
Share on other sites

Ok I'm having an issue with a simple PHP Inlcude that I've never ran in to before. Maybe you guys can help.

I'm trying to include a picture simply titled 'promo1.jpg'.. I go about the normal PHP include way with this code:

<?php include $_SERVER['DOCUMENT_ROOT'] . '/images/promo1.jpg'; ?>

This proceeds to only output a question mark '?'. No error message. Nothing else. Just the server saying "What the hell?". I've tried not doing the DOCUMENT_ROOT route and tried more locally but still same '?'. Any ideas on this one? Any help is appreciated, thanks.

 

You can't include an image.

You have to echo image inside a html image tag.

That was simple.

Link to comment
Share on other sites

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.