Jump to content

Not outputting image?


ash992

Recommended Posts

Hey guys so I'm not sure what's wrong.. I'm trying to echo an image using some variables... simple stuff really but for some reason it's not working...

 

This is the code in php,

echo '<div align="left" class="advertpo"><img src="adverts/' . $UID. "/" . $UID . '.png"> </div>';

 

And here is what is showing when you view source,

<div align="left" class="advertpo"><img src="adverts/1/1.png"> </div></td></tr>

 

I call also press on the img link (adverts/1/1.png) And it shows me the image fine, but for some reason, when i load the page, It's not showing me the image? Anyone got any clue?

 

Thank-you very much in advance guys!

Link to comment
https://forums.phpfreaks.com/topic/266254-not-outputting-image/
Share on other sites

Ahah okay, well,

 

 

UID is defined here, so it's just getting a variable from the database, I can echo it and it has the right value(1), So i don't know what the problem really is.. o.0

 

$UID = $b['UID'];

 

 

Additional details:

I recently moved servers and this exact script worked fine before the move?

 

 

-Thanks again

Nope, There's no css in that area, It's just outputting to a table,

 

<tr><td colspan="2">
<div class="advertchangepo"><a href="engines/change.php"><div class="bigG"> Your advert  [Change] </div></a>
</div>
<?php
echo '<div align="left" class="advertpo"><img height="90px" width="728" src="adverts/' . $UID. '/' . $UID . '.png"> </div>';
?>
</td></tr>

 

 

I'm afraid you need to log into the page to see it, you can see the image at http://adspring.co.uk/adverts/1/1.png

 

Yet again though when i've tried to just <img src=""> That link with php there's still no output... And yet again this did all work before i switched servers.. So really not a clue what is wrong, :s

What is in your stylesheet for 'advertpo'?

 

Are you able to load the image in your browser by using http://www.yourdomain.com/adverts/1/1.png directly in the address bar? If not, it's probably a path issue.

What Html code do you mean? Or are you talking about ,

 

<tr><td colspan="2">
<div class="advertchangepo"><a href="engines/change.php"><div class="bigG"> Your advert  [Change] </div></a>
</div>
<?php
echo '<div align="left" class="advertpo"><img height="90px" width="728" src="adverts/' . $UID. '/' . $UID . '.png" /> </div>';
?>
</td></tr>
</table>
</div>

 

Thanks again guys

Ahh my apologies, And I've just realized that tag was empty..

 

The tag's been removed from the stylesheet + php code,

 

<?php
echo '<div align="left"><img height="90px" width="728" src="adverts/' . $UID. '/' . $UID . '.png" /> </div>';
?>

 

It's still not working though :/

 

 

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.