Js in the HTML similar to the questionnaire gets the answer selected by the user and how to pass the value to PHP

Source: Internet
Author: User
Js in the HTML similar to the questionnaire gets the answer selected by the user, and how to pass the value to PHP php is basically zero. now, you need to write a questionnaire page and click the submit button.
Get the answers to all the questions in a loop, put them in an array, and write the algorithm for getting results through the answers, a PHP file.
But I don't know how to call this answer array in the PHP file. it's stupid to solve it.


Reply to discussion (solution)

You always want to send it to php.

You always want to send it to php.



Yes ~ The result of this array is calculated using the code in php.

Submit to PHP. There are two types. 1. submit form. 2. submit Ajax.

Do you want to know which one to use?

Do I have to submit a post directly?

Submit to PHP. There are two types. 1. submit form. 2. submit Ajax.

Do you want to know which one to use?



Can you tell me about these two types? Not quite familiar ..

Do I have to submit a post directly?



How to write a post submission? =

Put the content of your questionnaire into one

Li


Use $ _ POST to get your baidu

Form action = 'php file'

Or you can use AJAX to submit all of them.

Basic problems can only be discussed.

Form submission. you can view the html form content through form tag control.
Ajax asynchronous processing allows you to view ajax-related content of js or jquery.

Beginners, great efforts

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.