Question:

How do I program a adoptable pet image in PHP?

by Guest33047  |  earlier

0 LIKES UnLike

Like the ones at chickensmoothie.com that change after a couple weeks after you own them.

 Tags:

   Report

1 ANSWERS


  1. You'd make 14 different pet images and make each one a little bit bigger.

    Then you'd create a database, login/registration system and a pet page and make the number of days the pet has been owned increment by one after 24 hours, and then retrieve the corresponding pet image for the amount of days the pet has been alive.

    For example:

    <?php

    include("database.php");

    $query = "SELECT petage FROM users WHERE username = '$username'";

    $result = mysql_query($query);

    $p = mysql_fetch_array($result);

    $petage = $p[petage];

    if($petage == '1') {

         echo "<img src=http://example.com/petaged1.gif alt=Your pet is 1 years old />";

    }

    ?>

    Good luck anyway, instead of a picture maybe a flash animation?

    Good luck!

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.