Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

PHP guessing Game

Posted on 2008-06-16
1
Medium Priority
?
416 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
The viewer will learn how to count occurrences of each item in an array.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month20 days, 23 hours left to enroll

810 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