PHP + SQL + Java Script (or JQuery) Assignment #6Assignment 6 is a remake of assignment 5. In assignment 5, you created a list of image URLs and a list of corresponding labels.In assignment 6, you will not put either list on the page. The image URLs and labels will go in a database on the server, from where server-side PHP code will extract the next image and random buttons. In this assignment each round of the game will be a new page, generated by server-side PHP, augmented by a smaller amount of JavaScript on the client side.If you have a clean implementation in assignment 5, for assignment 6 you should be able to reuse the HTML and CSS parts, add the necessary PHP code into the HTML page. If you wish to avoid having to output the JavaScript parts from the PHP page, you can create a .js source document for the remaining JavaScript code and use a element to load it.To get you started, note that a PHP page looks just like an HTML page, with bits of PHP code interspersed between the HTML. The PHP code will do whatever it does and then write or print stuff to fill in bits of the page using write() or printf() calls. In this case, the PHP will be used to specify the img source, and labels for the 4 buttons. JavaScript code will be responsible for knowing which button has the correct answer and changing the page in some way depending on whether the guess was right and wrong. The “next” button should cause a new page to be loaded.In the last assignment, most of you had very complicated code for selecting the new image and button then randomly populating buttons around it. For this assignment, I recommend following the very clever approach that doesn’t select a new image, per se, but just randomly populates the four buttons, and then, having done so, has the label in button[0] be the new image. I suggest you use this approach for populating the page in PHP. On the JavaScript side, on load, it simply selects one of the buttons at random, and swaps it with the initial label in button[0]. Remember which one it was so you know which button has the correct answer. Or, simpler yet, in the swap, just keep the label that moved in temp so you can compare it with the value or innerHTML of the target from the click event. (The code that is provided does not yet include this behavior. Part of your assignment is to do this.)Make sure you watched the videos so that you know how to do all of the following steps.Step 1. Create a SQL table with at least the following three fields: id, name (or label), and url. The index can be an auto-increment field. See the video for how to do this.(If you already have MySQL database running, this becomes very simple). For writing your queries I find SQL workbench confusing. You can use Toad or HeidiSQL for your IDE. In the video I show HeidiSQL. This is just to type your SQL commands and execute them.Step 2. Populate the table with URLs and labels. Remember to use SQL code for this step and the previous one since you will have to submit the SQL code with your assignment to set up and populate the instructor’s database for grading.Step 3. Modify the code to complete your homework. As you complete each step, make sure that you test it in your browser.I am still seeing too many students copying large parts of solutions and then trying to get it to work. That approach is heroic, but in the end will prove to be more work, generally much more work, and less educational, than simply working on the problem one little step at a time. For this assignment, follow the steps. Keep a copy of each step in case you want to go back to the last step that worked well and try a different solution. Remember, NEVER HAVE YOUR CODE MORE THAN ONE CHANGE AWAY FROM SOMETHING THAT WORKS. Incremental or stepwise development is the secret of success on any large project.For this assignment, you must submit all of your sql, php, js, and css files. You must include the sql code for creating and populating your table. Put that in a .sql file. If you populated your table from a .csv file (recommended) include that file as well.The next and final assignment will be to modify this solution (once again) to use AJAX for updating the page to the next challenge, instead of reloading the entire page.Note: (Optional) for keeping track of the score, one student suggested a nice HTML5 option, using the new localStorage object. Because every page loads anew, to make that work with this solution, you need a separate page that is your start page, that sets the score to 0 and then calls the first flashcard page (or has an a element for starting the game). http://www.w3schools.com/html/html5_webstorage.asp




Why Choose Us

  • 100% non-plagiarized Papers
  • 24/7 /365 Service Available
  • Affordable Prices
  • Any Paper, Urgency, and Subject
  • Will complete your papers in 6 hours
  • On-time Delivery
  • Money-back and Privacy guarantees
  • Unlimited Amendments upon request
  • Satisfaction guarantee

How it Works

  • Click on the “Place Order” tab at the top menu or “Order Now” icon at the bottom and a new page will appear with an order form to be filled.
  • Fill in your paper’s requirements in the "PAPER DETAILS" section.
  • Fill in your paper’s academic level, deadline, and the required number of pages from the drop-down menus.
  • Click “CREATE ACCOUNT & SIGN IN” to enter your registration details and get an account with us for record-keeping and then, click on “PROCEED TO CHECKOUT” at the bottom of the page.
  • From there, the payment sections will show, follow the guided payment process and your order will be available for our writing team to work on it.