WordPress.org

Ready to get started?Download WordPress

Forums

PHP Forums or Easy Script? (8 posts)

  1. Tek
    Member
    Posted 9 years ago #

    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!

  2. Kafkaesqui

    Posted 9 years ago #

    1. Dig around here:

    http://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" />";
    ?>

  3. Tek
    Member
    Posted 9 years ago #

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

  4. Kafkaesqui

    Posted 9 years ago #

    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.

  5. Tek
    Member
    Posted 9 years ago #

    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!)

  6. Kafkaesqui

    Posted 9 years ago #

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

  7. Tek
    Member
    Posted 9 years ago #

    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*

  8. thoth92
    Member
    Posted 8 years ago #

    Same here. Why won't it work?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.