Solved

PHP guessing Game

Posted on 2008-06-16
1
403 Views
Last Modified: 2012-05-05
I am looking for a php "guest who the photo is" script which would have so many guess and then it would gave the answer wrong or right and how many guess it took to answer the question.

I guess I could write one, but I wouldn't even know were to start. I am just learning php, it would be nice if I could fins a script that is all ready made to see how it was created.
0
Comment
Question by:starview
1 Comment
 
LVL 6

Accepted Solution

by:
nitinsawhney earned 500 total points
Comment Utility
Hi,

Here is one script that is very much similar to what you are looking for.

http://webscripts.softpedia.com/script/Ad-Management/Guess-Stars-Script-42483.html

But creating one should not be difficult either.

Just a brief discussion about the approach.

First of all lets create the databases:
Let's assume that we'll only allow registered users to take a guess then we should have a Users table.
1. Users
   userid PK
   Name
   email  etc.

Now we need tables for storing the photos and their guesses.

2. Photos
   photoid PK
   photoPath
   Identity(Answer)
   etc.. like date created etc.

3. Guesses
    photoid
    guess

These are basic tables that are required, Now you might want to record what users guessed so we can track that as well..

4. UserGuesses
    userid
    photoid
    isAnsweredCorrectly(yes/no)
    numberOfGuesses to answer.
  etc.

You might need some more tables depending upon the requirement.

Now we are ready with the tables, lets proceed with the admin section.
In admin section we would be needing scripts to manage registered users as well as the photos. So create the script to Add/edit/delete users and script to add/edit/delete the pictures. Also create scripts to add/edit/delete the guesses.

After this move to the front end. You would be needing following forms:
Login
MyPage -> shows user statistics
Play the Game -> Show any picture to the user for which he has not answered and show the guess, accept the answer and accordingly populate the tables.

You know what you need from the front end so go and code mate.

Hope this gives you enough to start with.
Happy learning
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This article discusses how to create an extensible mechanism for linked drop downs.
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to dynamically set the form action using jQuery.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now