Solved

PHP guessing Game

Posted on 2008-06-16
1
404 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

This article will show, step by step, how to integrate R code into a R Sweave document
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

910 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

24 Experts available now in Live!

Get 1:1 Help Now