php - depending on json response to take the inputs -


I will get an answer for a server that is in Jason format, below is Jason's reaction as there are several orbits which are only one Organization is the default organization, so when the organization changes, the organization is likely to have a big Jason on this, my 'HTML form is a form field for the location in which I have to select a location from several places. , On choosing the place, there A more web service will be there, and another form will be created to select one, and another form will be there <-> [["location": [{"building": ["default building "Name": "default location"}], "name": "default organization"}]

I have tried to do this, in this I have to call a web service, after selecting the name of the organization will send a JSN response after the organization's names, some organizations can be Since the peacock is one place, this location of the chosen organization should be shown only in the place drop box, then there is an option called where there can be more than one building in a specific location, so only the selected location buildings Should show buildings in the combo box.

The code I have completed here

  & lt; Head & gt; & Lt; Title & gt; PROFILE User Information & lt; / Heading & gt; & Lt; Link rel = "stylesheet" href = "style.css" type = "text / css" /> & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div id = "contact" & gt; & Lt ;? Php session_start (); $ Url = 'My Web Service'; $ Ch = curl_init (); Curl_setopt ($ ch, CURLOPT_URL, $ url); Curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, true); Curl_setopt ($ ch, CURLOPT_POST, true); Curl_setopt ($ ch, CURLOPT_POSTFIELDS, json_encode ($ useridofuser)); Curl_setopt ($ ch, CURLOPT_HTTPHEADER, array ("Content Type: Application / JS");) $ Response = curl_exec ($ ch); // resonance ('\ n'. "Server response: \ n \ n". $ Response); Curl_close ($ ch); // $ jsonde = "$ response" server parsing json response; $ Org = array (); $ Loc = array (); $ Bui = array (); $ Items = Jason_decode ($ response); Foreign currency ($ each item $ $) {$ loc [] = $ each- & gt; Location [0] - & gt; Name; $ Bui [] = $ each- & gt; Location [0] - & gt; Building [0]; $ Org [] = $ every- & gt; Name; }? & Gt; & Lt; Select name = "category_id" & gt; & Lt; Option value = "" & gt; & Lt; / Options & gt; & Lt ;? Php foreach ($ key = & gt; $ val as $ org) {? & Gt; & Lt; Option value = "& lt ;? php echo $ key ;;>" & Gt; & Lt ;? Php echo $ _SESSION ['organization']; ? & Gt; & Lt; / Options & gt; & Lt ;? Php}? & Gt; & Lt; / Select & gt; & Lt; Select name = "category_id" & gt; & Lt; Option value = "" & gt; & Lt; / Options & gt; & Lt ;? Php foreach ($ location as $ key = & gt; $ val) {? & Gt; & Lt; Option value = "& lt ;? php // echo $ key ;;>" & Gt; & Lt ;? Php echo $ valve; ? & Gt; & Lt; / Options & gt; & Lt ;? Php}? & Gt; & Lt; / Select & gt; & Lt; Select name = "category_id" & gt; & Lt; Option value = "" & gt; & Lt; / Options & gt; & Lt ;? Php foreach ($ key as $ bui = & gt; $ val) {? & Gt; & Lt; Option value = "& lt ;? php // echo $ key ;;>" & Gt; & Lt ;? Php echo $ valve; ? & Gt; & Lt; / Options & gt; & Lt ;? Php}? & Gt; & Lt; / Select & gt; & Lt; / Body & gt; & Lt; / Html & gt;    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

java - Reaching JTextField in a DocumentListener -

c# - Add Image in a stackpanel based on textbox input -