Solved

PHP guessing Game

Posted on 2008-06-16
1
406 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
ID: 21801351
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …

726 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