www.webdeveloper.com
Results 1 to 2 of 2

Thread: How to post array(that comes from PHP side) from HTML to PHP?

  1. #1
    Join Date
    Mar 2012
    Posts
    1

    How to post array(that comes from PHP side) from HTML to PHP?

    Hi;
    I have been developing with PHP (+smarty) just for 2 weeks. So the question may be trivial..

    On HTML side, I am filling my combobox with the array ($cust_ids) that is created on PHP side. Here I used Smarty shown above.

    HTML Code:
    <select name="customer_id">
       {html_options values=$cust_ids}
    </select>
    All I want is to post that array ($cust_ids) back to PHP side when I click on submit on that form (the same with the combobox appears).

    Is there something tricky I must do to post that array back to PHP side?

  2. #2
    Join Date
    Mar 2012
    Location
    Saint-Petersburg, Russia
    Posts
    97
    Nothing tricky. The simplest way is to use jQuery post() method (google for it) to send your data to server (as a json string or string with elements separated by newline characters for example), the server script should, when it receives such request, catch included data string, maybe parse it and then store it or use in any way you like.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles