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
https://forums.phpfreaks.com/topic/205509-include-not-loading-images/
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....)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.