HTML Form is not printing right from PHP page?

Brit24

I have an html page that collects data using a form with the multiple attribute, but when I try to echo out the data on the PHP page, it only echos out the last item selected.

  <select name="cars" multiple>
   <option value="car1"> BMW </option>
   <option value="car2"> TOYOTA </option>
   <option value="car3"> HONDA </option>

If I select BMW and TOYOTA, and try to echo $_POST['cars']; all it echos out is TOYOTA and not BMW. How do I get it to echo out everything that is selected?

Naga

Make select name as array type. like this and print_r($_POST['cars']);

<select name="cars[]" multiple>
   <option value="car1"> BMW </option>
   <option value="car2"> TOYOTA </option>
   <option value="car3"> HONDA </option>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Form action not going to right php page

From Dev

echo a html page and entering values into a form from php variables

From Dev

Printing or Echoing message in html page from javascript

From Dev

C/ HTML - Printing the username and password from an HTML Form

From Dev

Form submit from mailer.php goes to blank page. Possibly redirect to previous html page?

From Dev

How to choose an action page from a form and then submit values to that page HTML,PHP,Javascript

From Dev

PHP session data from form not being passed and/or not printing to screen

From Dev

Html + PHP contact form (Page Not found)

From Dev

Printing an html page from google cloud print and zapier

From Dev

Printing page from AJAX

From Dev

Type From right to left html / php

From Dev

how to pass HTML code as POST data from Jquery Form to PHP page?

From Dev

Way to get data from HTML form to Microsoft Flow without a page refresh and no php

From Dev

Create an entirely new html page with specified name fetched from form and add specific contents to it using PHP

From Dev

Unwanted white space on the right side of html / php page

From Dev

PHP is printing outside of HTML

From Dev

Put login form to the right of the page

From Dev

Printing HTML page and color changes?

From Dev

PHP form delete from MYSQL table dont delete the right row

From

Is there a right way to pass data into a React component from the HTML page?

From

Landscape printing from HTML

From Dev

Making form data stay on PHP page from a multi select form

From Dev

php form: take user back to previous page from register form

From PHP

How to pass and put variable from a php page into a another page(form)?

From Dev

Printing a HTML page without page information

From Dev

Printing JSP form data on another JSP page

From Dev

Qt Plain text edit, printing from right

From Dev

PHP font-size from HTML Form

From Dev

Send data from HTML form to php

Related Related

  1. 1

    Form action not going to right php page

  2. 2

    echo a html page and entering values into a form from php variables

  3. 3

    Printing or Echoing message in html page from javascript

  4. 4

    C/ HTML - Printing the username and password from an HTML Form

  5. 5

    Form submit from mailer.php goes to blank page. Possibly redirect to previous html page?

  6. 6

    How to choose an action page from a form and then submit values to that page HTML,PHP,Javascript

  7. 7

    PHP session data from form not being passed and/or not printing to screen

  8. 8

    Html + PHP contact form (Page Not found)

  9. 9

    Printing an html page from google cloud print and zapier

  10. 10

    Printing page from AJAX

  11. 11

    Type From right to left html / php

  12. 12

    how to pass HTML code as POST data from Jquery Form to PHP page?

  13. 13

    Way to get data from HTML form to Microsoft Flow without a page refresh and no php

  14. 14

    Create an entirely new html page with specified name fetched from form and add specific contents to it using PHP

  15. 15

    Unwanted white space on the right side of html / php page

  16. 16

    PHP is printing outside of HTML

  17. 17

    Put login form to the right of the page

  18. 18

    Printing HTML page and color changes?

  19. 19

    PHP form delete from MYSQL table dont delete the right row

  20. 20

    Is there a right way to pass data into a React component from the HTML page?

  21. 21

    Landscape printing from HTML

  22. 22

    Making form data stay on PHP page from a multi select form

  23. 23

    php form: take user back to previous page from register form

  24. 24

    How to pass and put variable from a php page into a another page(form)?

  25. 25

    Printing a HTML page without page information

  26. 26

    Printing JSP form data on another JSP page

  27. 27

    Qt Plain text edit, printing from right

  28. 28

    PHP font-size from HTML Form

  29. 29

    Send data from HTML form to php

HotTag

Archive