user2040878
user2040878

Reputation: 39

php can't see pictures

This is my php:

     <html>
 <head>
</head>
<body>
<?php 
include ('source\visuose\navigation.php');`enter code here`
include('source\visuose\social.php')
?>
</body>
 </html>

Navigation:

    <html xmlns="http://www.w3.org/1999/xhtml", lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../../css/style.css" />

Social:

<body>



  <div id="facebook"> 
   <a href="http://www.facebook.com" target="_blank">
   <img src="../../images/facebook-logo.jpg" width="81" height="36" />
     </a>

   </div><!--facebook ends-->




</body>
</html>

Why, when running php I can't see pictures? There is only a blank box, but I can press on them and go to my a href?

Upvotes: 1

Views: 2465

Answers (3)

Joachim Isaksson
Joachim Isaksson

Reputation: 180917

Can't be sure without seeing your file structure, but this is what it looks like;

Your "main" php is in the server root /main.php and includes source\visuose\social.php. Since social.php is included, the browser thinks it's a part of /main.php.

social.php gives the browser a relative path ../../images/facebook-logo.jpg, but since the browser thinks it's /main.php including it, it will navigate relative from that file, not source\visuose\social.php. When the browser navigates your relative path, it points to nothing useful.

You should also inspect the source of the generated page, right now you have multiple html and body tags wrapping each other in a strange way.

Upvotes: 1

Nimrod007
Nimrod007

Reputation: 9913

This is not a PHP issue fix the src of your image

    <img src="../../images/facebook-logo.jpg" width="81" height="36" />

and it would work

Upvotes: 0

Ravish Kumar
Ravish Kumar

Reputation: 632

it has to be issue with the path of the image. In firefox You just need to right click the images and select show image. To see where it is pointing ( aka coming from ) and check for what is the intended URL for the image ?

And then repair your images path accordingly.

Upvotes: 1

Related Questions