This demonstrates ajax sending data to server and receiving data from server. From server: (PHP) json_encode(..) (js) JSON.parse(..) Multiple variables go into one array. To server: (js) JSON.stringify(..) (PHP) json_decode(..) You can send separate multiple variables.fromserver1: