Alright, I have a hopefully easy question.

What I would basically like, is an image I can link through something like

<IMG SRC="random.php"> or <IMG SRC="random.gif"> or something like that.

Inside, would be something like..

<?
$image = rand(1,7);
// Code To Display Random Image Here
?>

Basically, I need to know what I must change or put so that it shows up.

An example of what I basically want to do is those IP signatures, which show your IP. However, the images would always stay the same.

Thanks!

    Did you even read my post? I'm not trying to do a random Image. I'm trying to display it via a remote link. I have searched, to no avail.

    My best guess would be that I need to play around with the MIME preferences, but I'm clueless as to where I would have to start.

      Foxhoundx, I undestand exactly what you mean, and I will refer you to my first post.

        Well I have read every link on the first two pages, nothing had anything on how to set up a server so you could do it. Perhaps you could stop being an asshole and accept the fact that I have already tried to search, and just answer my question? :rolleyes:

          Sorry mtimdog, I didn't see your reply.

          That's exactly what I want. I don't care about the text on it, but moreso the ability to remotely link it via an IMG tag. I'm just wondering what would be required to set up in order for this to be achieved, because obviously you can't link a direct PHP Script to an Image. πŸ™

            <?php 
            /* 
                By Matt Mullenweg  >  [url]http://photomatt.net[/url] 
                Inspired by Dan Benjamin  >  [url]http://hiveware.com/imagerotator.php[/url] 
                Latest version always at: 
                [url]http://photomatt.net/scripts/randomimage[/url] 
            */ 
            
            // Make this the relative path to the images, like "../img" or "random/images/". 
            // If the images are in the same directory, leave it blank. 
            $folder = ''; 
            
            // Space seperated list of extensions, you probably won't have to change this. 
            $exts = 'jpg jpeg png gif'; 
            
            $files = array(); $i = -1; // Initialize some variables 
            if ('' == $folder) $folder = './'; 
            $handle = opendir($folder); 
            $exts = explode(' ', $exts); 
            while (false !== ($file = readdir($handle))) { 
                foreach($exts as $ext) { // for each extension check the extension 
                    if (preg_match('/\.'.$ext.'$/i', $file, $test)) { // faster than ereg, case insensitive 
                        $files[] = $file; // it's good 
                        ++$i; 
                        } 
                    } 
                } 
            closedir($handle); // We're not using it anymore 
            mt_srand((double)microtime()*1000000); // seed for PHP < 4.2 
            $rand = mt_rand(0, $i); // $i was incremented as we went along 
            
            header('Location: '.$folder.$files[$rand]); // Voila! 
            ?> 

              You're basically looking for a tutorial like this.

              That's the basics, if you're gonna make something hi-quality, I'd suggest using truetype fonts ([man]imagettftext[/man])

                Write a Reply...