Jump to content

Include Not Loading Images


dinostatic

Recommended Posts

Hello! I am very new to php, so I was wondering how I could fix a simple problem (:

I want to use a php include to put content on a left column. The coding is really, really simple, it's just <?php include ("content/_left/connect.php"); ?>

 

Whenever I load this on to my test server the images on the connect.php file don't show up. Is this because of the php include or is this something within the code of connect? The code for the images is simple html, it's just <img src="../../Images/youtube_link.png" width="175" height="20" />

 

Also for the php include function, do I have to include a php file? Can it be an html file? Or something else?

 

I am new on coding by hand, so I apologize for any noobiness /: I am learning as much as I can on my own

Link to comment
Share on other sites

Like Mchl said you should check to see if you are pointing to the right path where your images are.

Because when you include a file (connect.php) what really is happening is, that all the code from the included file (connect.php) is getting put into the file that is including it (index.php). So the img tags src needs to be related to the index.php and not connect.php.

 

About your question if you have to include a php file, No you can pretty much include any file (.html, .txt .inc etc....)

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.