Jump to content

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 :/

 

 

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.