1

What would be the best way to go about this should I use php & mysql? so confused on where to start, still learning php, javascript

Markese P
  • 105
  • 1
  • 10

4 Answers4

1

You will need a combination of (probably) all 3:

Javascript and HTML

  • Responsible for managing the user interface
  • Allows user to send a request to the server. Request can be "I want to challenge B" or "I will accept/deny challenge from A"
  • Allows user to ask for update from the server, and shows server messages to the user such as "A has challenged you" or "B has accepted/denied your challenge"
  • Must have access only to public information; no info you want to hide from the user (such as other users' emails or links to other challenges) should be visible to Javascript/HTML

PHP

  • Responsible for handling users' requests and returning responses or sending updates
  • Manages registrations, account changes, payments, account deletions etc...
  • Interacts with the database (eg: MySQL) to store or retrieve data
  • Generates challenge links
  • Tracks users' performance
  • Handles all the business logic and private data: how users get ranked, how users performed in challenges, did user enter correct password,...

MySQL

  • Responsible for storing user data and challenge data
  • Returns results to PHP when scripts ask for data
  • Updates stored data at PHP's command (eg: update users' rankings)
BeetleJuice
  • 39,516
  • 19
  • 105
  • 165
0

you can use javascript or PHP it does not matter.Only thing you got to remember is if you want to save details to Database like mysql then you got to send details to PHP.

  1. You can use javascript to make the client side checks and send the finalized details to PHP for further processing. This reduces the server side processing.

  2. You can do the HTML form check in PHP also if you do not want to use javascript.

Ravistm
  • 2,163
  • 25
  • 25
  • thanks , so what Im asking is can this be done with javascript or php alone or would I need another language ? – Markese P Jul 23 '16 at 05:34
  • these two are sufficient. As i have explained, do client side processing using javascript/jQuery and submit them to PHP for further storage is required. – Ravistm Jul 23 '16 at 05:37
-2

If you are a beginner go with PHP you can easily find solution related to MySql/PHP on the web.

Thanks

Sameer Ahmed
  • 160
  • 6
-2

depending on the needs for example i will use both javascript and php for validation of the form because

  • javascript will work faster but its code can be changed
  • php is slow but its code is hidden and cannot be changed
  • How can you communicate between two users in two system with JS only? And I think question is not for asking how to validate. – Asim K T Jul 23 '16 at 07:27