Jump to content

Need help with a PHP script


fairwells

Recommended Posts

:) Hi I'm using the php Enthusiast script for fanlistings on my website.  I'm playing around with collective stats.  You can check it out here http://www.fairwells.com/admin/collective.php

 

But I have a question... under newest joined and random joined, for CODE(image file) it just lists the image file.  I would like it to show the actual image.  How do I do that in php?

 

I'm very new at PHP, so I don't have a clue.

 

Here's the current code I have that displays only the file name:

<?php echo $owned_newest['imagefile'] ?>

 

How can I make it so it displays the actual image?

Link to comment
https://forums.phpfreaks.com/topic/98097-need-help-with-a-php-script/
Share on other sites

this has nothing to do with "php"

browsers use xhtml and html to create "mark-up" tags that present elements to the end user through the browser's rendering of the given tags.

 

To display images the proper <img /> tag must be used.

 

Please reference a basic html tutorial on how to use the <img /> tag properly

You need to create an HTML <img> tag:

<?php
echo '<img src="' . $owned_newest['imagefile'] . '">';
?>

 

Ken

 

Thank you.  That's exactly it.  You are awesome.  But now I can't see the image.  I went to another forum and it said to include the config.php file, so I did that, but it still doesn't work.

 

She said "If your fanlistings are at another place, is that still on the same domain/ server account? Try including the config-file by using the full path, usually like this:

 

/home/username/public_html/folder_of_fanlistings"

 

But how would I code that?

 

I'm sorry I'm such a noob when it comes to PHP.

 

Thank you so much!

<?php

include('/home/username/public_html/folder_of_fanlistings');?>

 

That doesn't work.  Is there a way that I can make a php script that specifies the directory path of the image.  The code is such that it picks a random image or the last joined image.  But I don't know how to specify the path.  So that's why it's not showing up.  My config.php file is fine.

 

 <?php
echo '<img src="' . $joined_newest['imagefile'] . '">';
?>

 

That's the code.

 

I want something like:

<?php

echo '<img src="home/username/public html/fanlistings/' . $joined_newest['imagefile'] . '">';

?>

 

Because that last part of the code generates an image that's in that directory.  But I don't know how to specify it.

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.