AJAX quiz/list editor

Posted on 2009-04-25
Last Modified: 2012-08-13
Hi there,

Can someone help me out with a quiz creator script?

The idea is, that i have 62 images 01.jpg, 02.jpg, 03.jpg .... 60.jpg, 61.jpg, 62.jpg. and I want to create 3 questions for each of them. (like, what animal is this? dog, cat, bird)

What I want is that they would be in a list, like so:

  for ($i=1; $i <= 62; $x="", $i++) {
    if (strlen($i) == 1) {
    echo "
      <a href=\"#\"><img src=\"/thumbs/gallery/$x$i.jpg\" /></a>

and once I click on an image, i would get a ajax form popup or slide down or whatever, and I would be able to enter question1, question2, question3 and save it to mysql using this query:  

$do = mysql_query('INSERT INTO quiz (id,image,question1,question2,question3) VALUES (NULL,"' . $_POST['image'] . '","' . $_POST['question1'] . '","' . $_POST['question2'] . '","' . $_POST['question3'] . '")');

I tried doing this and it's fine if there is only 1 image, but I just can't get ajax to do this dynamically with all  of them
Question by:CodilX
    1 Comment

    Accepted Solution

    found the solution on another site :)

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
    Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
    Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
    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 …

    733 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

    18 Experts available now in Live!

    Get 1:1 Help Now