dinostatic Posted June 22, 2010 Share Posted June 22, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/205509-include-not-loading-images/ Share on other sites More sharing options...
Mchl Posted June 22, 2010 Share Posted June 22, 2010 Check if the resulting HTML is correct and if the image path leads to actual file. Quote Link to comment https://forums.phpfreaks.com/topic/205509-include-not-loading-images/#findComment-1075493 Share on other sites More sharing options...
joePHP Posted June 22, 2010 Share Posted June 22, 2010 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....) Quote Link to comment https://forums.phpfreaks.com/topic/205509-include-not-loading-images/#findComment-1075775 Share on other sites More sharing options...
dinostatic Posted June 22, 2010 Author Share Posted June 22, 2010 oh!!!! thanks so much! yea, i have the path of the image leading from the connect.php file not the index.php file! that makes so much more sense! thank you so so much (: Quote Link to comment https://forums.phpfreaks.com/topic/205509-include-not-loading-images/#findComment-1075858 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.