Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Dec 2005
    Posts
    2
    Member #
    12091
    I'm racking my brain over a project I'm working on to do a Photo of the day kind of thing. Now, I'm more of a designer than a developer... so go easy on me

    I got it working based on a DAY of the month variable. I'm using PHP. Unfortunately right now it only allows me to do 31 days (cause it goes by DAY with no MONTH variable). Can someone expand on how I'd allow for a year's worth of photos? Remember, I'm a code dummy (I'm a designer)

    Here's the PHP CODE: http://www.regalthreads.com/babe2.php

  2.  

  3. #2
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    PHP code resides on the server. Only the code output is sent to the client (browser).
    Hence, your link will show none of the code in question, only the output HTML.

    If you want us to look at the script, you'll have to send it as an attachment to your post.
    S. Rosland

  4. #3
    Junior Member
    Join Date
    Dec 2005
    Posts
    2
    Member #
    12091
    Ooops. Here is the code.

    PHP Code:
    <?php

    $totalPics
    ="20";                    // Total photos in folder

    $photoOfTheDay = Array (           // Add up to 31 photos below

       
    '1' => 'images/babes/001.jpg' ,     // Name of or Path to image
       
    '2' => 'images/babes/002.jpg' ,     // Name of or Path to image
       
    '3' => 'images/babes/003.jpg' ,     // Name of or Path to image
       
    '4' => 'images/babes/004.jpg' ,     // Name of or Path to image
       
    '5' => 'images/babes/005.jpg' ,     // Name of or Path to image
       
    '6' => 'images/babes/006.jpg' ,     // Name of or Path to image
       
    '7' => 'images/babes/007.jpg' ,     // Name of or Path to image
       
    '8' => 'images/babes/008.jpg' ,     // Name of or Path to image
       
    '9' => 'images/babes/009.jpg' ,     // Name of or Path to image
       
    '10' => 'images/babes/010.jpg' ,     // Name of or Path to image
       
    '11' => 'images/babes/011.jpg' ,     // Name of or Path to image
       
    '12' => 'images/babes/012.jpg' ,     // Name of or Path to image
       
    '13' => 'images/babes/013.jpg' ,     // Name of or Path to image
       
    '14' => 'images/babes/014.jpg' ,     // Name of or Path to image
       
    '15' => 'images/babes/015.jpg' ,     // Name of or Path to image
       
    '16' => 'images/babes/016.jpg' ,     // Name of or Path to image
       
    '17' => 'images/babes/017.jpg' ,     // Name of or Path to image
       
    '18' => 'images/babes/018.jpg' ,     // Name of or Path to image
       
    '19' => 'images/babes/019.jpg' ,     // Name of or Path to image
       
    '20' => 'images/babes/020.jpg' ,     // Name of or Path to image


    );

    // Place day of month in variable 'x'
    $x=date("j"); 

    // If value of date exceeds the amount of photos then pick a random photo to display
    if($x $totalPics) { $x=rand(1,$totalPics); }

    // Display image
    echo <<<EOC
    <center><img src="$photoOfTheDay[$x]"></center>
    EOC;

    ?>


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 06:01 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com