+ Reply to Thread
Results 1 to 10 of 10

Thread: Random Images And text

  1. #1
    ak007's Avatar
    ak007 is offline x10 Sophmore ak007 is an unknown quantity at this point
    Join Date
    Jun 2005
    Location
    127.0.0.1
    Posts
    108

    Random Images And text

    Heres A Very Simple Tutorial For Displaying Random Images And Text Lets Start With Random Images
    ------------
    Functions We Will Use:
    shuffle()
    ------------
    PHP Code:
    <?php
    $images 
    = array("whacky.jpg" "bush.jpg" "xxx.jpg" "BooM.jpg" "blah.png");
    shuffle($images);
    echo 
    "<img src=\"images/$images[1]\"/>";
    ?>
    Now The Random Text
    PHP Code:
    <?php
    $quotes 
    = array("X10hosting RockZ","Blah Blah ","Knock Knock!!!","Whos there?","Its me!!","Who?");
    shuffle($quotes);
    echo 
    $quotes[1];
    ?>
    Comments Question And Suggestions Are Welcomed ;)
    Last edited by ak007; 10-26-2005 at 05:14 PM.





  2. #2
    minievan Guest

    Re: Random Images And text

    Where would this work?
    *Php DumbF@!?*

  3. #3
    ak007's Avatar
    ak007 is offline x10 Sophmore ak007 is an unknown quantity at this point
    Join Date
    Jun 2005
    Location
    127.0.0.1
    Posts
    108

    Re: Random Images And text

    LOL Just Create A New page And Put the Code in It
    And For Random Images To Add New Images Just Add The Name Of The Images in The Array:
    PHP Code:
    $images = array("whacky.jpg" "bush.jpg" "xxx.jpg" "BooM.jpg" "blah.png" "YOUR IMAGE NAME GOES HERE!!!!"); 
    And To Change The Image Directory Where The Script will Pick The Images Just Change
    PHP Code:
    echo "<img src=\"images/$images[1]\"/>" 
    TO

    PHP Code:
    echo "<img src=\"MY_IMAGE_DIR/$images[1]\"/>" 
    Last edited by ak007; 11-18-2005 at 03:35 AM.





  4. #4
    Jake's Avatar
    Jake is offline Developer Jake is an unknown quantity at this point
    Join Date
    Apr 2005
    Location
    Winona, MN
    Posts
    2,084

    Re: Random Images And text

    wow, this works very nicely... even though i would never really need to use it, at least notyet... good tutorial though!
    Jake Omann | Developer
    █ 888-X10-9668 - jake[@]x10hosting.com
    x10Hosting - Giving Away Hosting Since 2004
    Premium Hosting | VPS Services

  5. #5
    minievan Guest

    Re: Random Images And text

    I will defo be using them. Keep the thread up!!!

  6. #6
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: Random Images And text

    You should teach them what shuffle() does, and why what happens, well, happens. Just a thought though.

    http://php.net/shuffle

  7. #7
    Kay's Avatar
    Kay
    Kay is offline
    x10 Lieutenant Kay is an unknown quantity at this point
    Join Date
    Jul 2005
    Posts
    402

    Re: Random Images And text

    Thats would not use it now - but maybe in the future.

  8. #8
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: Random Images And text

    What? I don't understand what you said..

  9. #9
    minievan Guest

    Re: Random Images And text

    Me Either.
    I Guess we wont worl out what he said. ''gamez93'' Banned...

  10. #10
    ak007's Avatar
    ak007 is offline x10 Sophmore ak007 is an unknown quantity at this point
    Join Date
    Jun 2005
    Location
    127.0.0.1
    Posts
    108

    Re: Random Images And text

    Yeah He's Now Banned Cuz Of So Many Annoying Complaints





+ Reply to Thread

Similar Threads

  1. Replies: 5
    Last Post: 11-26-2006, 12:58 AM
  2. Replies: 1
    Last Post: 11-04-2006, 06:49 PM
  3. Replies: 6
    Last Post: 08-31-2006, 03:53 PM
  4. Images
    By swrpg in forum Free Hosting
    Replies: 3
    Last Post: 08-31-2006, 09:26 AM
  5. add text to this gif animation
    By Josh in forum The Marketplace
    Replies: 8
    Last Post: 07-26-2006, 09:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers