fairwells Posted March 27, 2008 Share Posted March 27, 2008 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 More sharing options...
cooldude832 Posted March 27, 2008 Share Posted March 27, 2008 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 Link to comment https://forums.phpfreaks.com/topic/98097-need-help-with-a-php-script/#findComment-501873 Share on other sites More sharing options...
kenrbnsn Posted March 27, 2008 Share Posted March 27, 2008 You need to create an HTML <img> tag: <?php echo '<img src="' . $owned_newest['imagefile'] . '">'; ?> Ken Link to comment https://forums.phpfreaks.com/topic/98097-need-help-with-a-php-script/#findComment-501874 Share on other sites More sharing options...
fairwells Posted March 27, 2008 Author Share Posted March 27, 2008 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! Link to comment https://forums.phpfreaks.com/topic/98097-need-help-with-a-php-script/#findComment-501892 Share on other sites More sharing options...
darkfreaks Posted March 27, 2008 Share Posted March 27, 2008 <?php include('/home/username/public_html/folder_of_fanlistings');?> Link to comment https://forums.phpfreaks.com/topic/98097-need-help-with-a-php-script/#findComment-501894 Share on other sites More sharing options...
fairwells Posted March 27, 2008 Author Share Posted March 27, 2008 <?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. Link to comment https://forums.phpfreaks.com/topic/98097-need-help-with-a-php-script/#findComment-501917 Share on other sites More sharing options...
cooldude832 Posted March 27, 2008 Share Posted March 27, 2008 for a file pointer that is for a html tag you can't use internal server references as the browser doesn't know how to use them. You must use the public DNS based file pointer or IP based file pointer. Link to comment https://forums.phpfreaks.com/topic/98097-need-help-with-a-php-script/#findComment-502062 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.