Forum Moderators: coopster

Message Too Old, No Replies

How to include an image in with the rest?

         

Simone100

8:04 am on Aug 22, 2007 (gmt 0)

10+ Year Member



Hello, I'm trying to get this code to show the images along with other files but it won't work. I tried adding an image tag and that didn't help, didn't know how to include an if statement if its a ".gif " or something. Can someone please tell me how to include an image in with the rest of these in the array? Also, are bbc codes allowed here, can't find them. Thanks very much.

<?php
ini_set('error_reporting', 8191);
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
$maximum = 3;
$a = (isset($_COOKIE['e']) && intval($_COOKIE['mb']) < $maximum)? intval($_COOKIE['e'])+1 : 1;
setcookie("e", $a, time()+60*60*24*180);
$currentFile = $a;
$allfiles = Array();
$allfiles= "thisfile.txt";
$allfiles[2] = "thatfile.html";
$allfiles[3] = "thatfile.gif";
$get_content = file_get_contents($allfiles[$currentFile]);
echo $get_content;
?>

.

[1][edited by: Simone100 at 8:07 am (utc) on Aug. 22, 2007]

dreamcatcher

8:24 am on Aug 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Simone100,

For BBCode, look for the 'Style Codes' link on the message posting page.

dc