• Here is Tek’s annoying question of the day!

    (two this time)

    1.Where is a good php site where people help newbies out?

    2. Is there a script out there that will pull set images dependent on time of day?

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • 1. Dig around here:

    https://www.devshed.com/c/b/PHP/

    2. A PHP quickie:

    <?php
    $hour = date('G');
    if($hour > 5) {
    $image = "/images/morning.jpg";
    $alt = "Mornin' all.";
    }
    if($hour > 11) {
    $image = "/images/afternoon.jpg";
    $alt = "Where does the day go.";
    }
    if($hour > 17) {
    $image = "/images/evening.jpg";
    $alt = "Getting late.";
    }
    if($hour > 22 || $hour < 6) {
    $image = "/images/night.jpg";
    $alt = "Nighty night.";
    }
    echo "<img src="$image" alt="$alt" />";
    ?>

    Thread Starter Tek

    (@tek)

    =) Awsome! I would just put that PHP scrip in the same folder as my images folder?

    Put it there and perform an include on your page, or just insert the code into your page, or create a plugin with it. It’s up to you.

    Thread Starter Tek

    (@tek)

    Yay! Thank you for your help. =)

    (and that link you gave me is great! I needed to figure out how to make a form that linked to SQL and how to get SQL to send the results to a page. When I say I am a newbie… I really mean it. I know how a parse error happens and that is it!)

    Hey, knowing about parse errors is pretty important! :)

    Thread Starter Tek

    (@tek)

    Can I get a little bit more help on this?

    I tried to use your wee script that you made but it isn’t working for me. I am trying to call it from the css:
    #topimage { background-image: url(images/time.php); }

    It’s not working… yet there are no errors either.

    *scratches head*

    Same here. Why won’t it work?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘PHP Forums or Easy Script?’ is closed to new replies.