Random Image PHP Code

This will display a random image on a web page. Images are selected from the folder of your choice.

Create a php page with the following (making necessary changes) and upload to your server :

<?php

// Change to the total number of images in the folder
$total = “11″;

// Type of files to use eg. .jpg or .gif
$file_type = “.jpg”;

// Change to the location of the folder with your images
$image_folder = “images/random”;

// You do not need to edit below this line

$start = “1″;

$random = mt_rand($start, $total);

$image_name = $random . $file_type;

echo “<img src=\”$image_folder/$image_name\” alt=\”$image_name\” />”;

?>

Name your images 1.jpg, 2.jpg etc.

Add this line to your page where you want the images to appear:
<?php include “randomimage.php”; ?>

phpinfo()

After having to use this again to get info on a clients server (nope unfortunately not all my clients host with me) I thought I would share for those who are not familiar with the use of it

Because every system is setup differently, phpinfo() is commonly used to check
configuration settings and for available predefined variables on a given system. Also, phpinfo() is a valuable debugging tool as it contains all EGPCS (Environment, GET, POST, Cookie, Server) data.

drop the following in to a blank php file and name it as you choose such as phpinfo.php and upload to your server. Call this file from your browser yourdomain.com/phpinfo.php to get the results. You can see mine here

<?php

phpinfo()

?>

PHP on the brain

This is stuff that you come up with when you work with code to much.

You talk with your friends online like this

echo 'Hey how ya doing';
instead of just Hey how ya doing...

Or you feel the need to use “<br /> tags instead of just hitting enter

You find yourself “adding quotes” around things for no reason

You ask a question and automatically type ?> instead of just ?

Here is some more….

Jeni could you imagine if i wrote my emails to you like this

<?php
$to = 'Jeni';
$from = 'Heather';
echo date("F j, Y");
echo "<br /><br />Dear $to, <br />";
echo "How are you doing these days? <br />";
echo "<br />With Love,<br /> $from";
?>

You can see the output of the above here

This is pretty funny php humor here but please be warned the follow is not really appropriate …

First one real basic
if($coding >= $good_sex)
{
$you = 'nerd';
}

Then you have stuff like this

$name = 'Heather';
if($name == 'Balagh')
{
$nerd = true;
}
else if($name = 'Heather')
{
$time['food'] = 1;
$time['sex'] = 2;
$time['coding'] = 3;

asort($time);

$c = 0;
foreach($time AS $preference)
{
$c++;
echo 'PREFERENCE (IN ORDER)
';
echo $c . '/ ' . $preference;
}

$nerd = false;
}

Then you can get a little more nasty with this

foreach ($thrust as $sounds)
{
$DB_site->query("INSERT INTO woman (`item`) VALUES
('male_genitalia'),
('dildo'),
('other_toys'),
('fingers')
");
echo $sounds;
}

My list of must have programs

Here is my list of MUST HAVE programs as a designer/programmer

Macromedia Dreamweaver (not in designer view lol)
Macromedia Flash
Araxis Merge (great for code comparison)
Antechinus JavaScript (a great javascrpt editor)
Topstyle (great for CSS (Cascading Style Sheets))
FileZilla (or any decent ftp client)
All Internet Browsers ( Mainly IE, Firefox, Opera)
Photoshop
Illustrator

And of course the most important a great media player with lots of tunes with lots of coffee, sugar and creamer at your side to keep yourself going…

Know of a great program for me to check out, leave me a comment

In one years time…

In December of 2004 I started to play around with a forum.  At the time I knew nothing about how to install them or anything related to them.  I barely knew how to use them. 

Shortly after using an automatic feature to install my forum.  I had people tell me that I should convert my forum to a better script (forum).  I had no idea what to do.  I read the instructions but it totally confused the heck out of me.  I finally got it done, and it shocked the heck out of me.  Then I had people saying that I should install modifications to the forum to give it extra features.  That is what really confused me.  It was a totally different language for me.  Yes it tells you in the modifications to look for this and add or replace with that.  But I still just didn’t get it.

I then met a guy from Canada on phpbb.com named Indie (David).  He was nice enough to try to explain it to me but I still  could not grasp it.  He then went ahead and installed the modifications working hours with me on things.  After hours of talking to him, asking a billion and one questions and looking at what he did I slowly started to understand the process of adding modifications to forums, even though I still didn’t understand how the code worked.  Anyhow it became very addicting, I was always on the endless search for the coolest and newest mods.

I soon started to learn how to install scripts on my own.  And after hours and hours of staring at the PHP Language it started to make since to me.  Something that before looked like alot of numbers, odd characters, and unknown words all now automatically gets translated in my head.

So in one years time I went from using MS Frontpage WYSWYG (what you see what you get) editor to design websites (im so ashamed of my self for using it), not knowing anything about php or databases.  To creating/writing websites in code view with Dreamweaver and editing just about any php script to do what i want.  Of course some still requires the assistance of my friend Indie.

I have total faith in my self that in another year I will be creating my own scripts and databases from scratch.  Ohh yea if your wondering about Indie, he is now one of my best friends online.  We talk just about everyday for hours…..Thanks Indie….

And of course I say thanks to my husband for him dealing with my obsession to learn this and letting me be online constantly.  I love you..