Use Rexsee, Jquery, PHP to develop data interaction issues in mobile applications
?
Rexsee community of an experience paste, turn around, mainly to introduce the realization of data interaction this piece, learn together:
?
When developing a mobile sales product, users require data interaction through webservice calls. Using Rexsee,jquery-mobile,php,webservice Several development tools can do the device call to complete the photos, positioning and other functions, using the Juqery-mobile development interface, using php+ SOAP completes the data interaction function of database and webservice, using PHP to encapsulate the return data and return to the front end through JSON, so that the data can be asynchronously interacted with, and the return result standard is uniform and usability is strong. Here are a few examples:
Login page:
?
?
Mobile Sales
?
?
The above page through Jquery-mobile display a login page, click Submit after the asynchronous call Func_sap function complete Webserivce call and return, return data in JSON form, through JavaScript JSON function extracts and processing data.
func_soap.php file
$phone); $objectresult = $soap _client->agetshop ($param); $simpleresult = $objectresult- >AgetShopResult; $obj = simplexml_load_string ($simpleresult); $obj->shop[0]->addchild ("Oper", "Getshop"); $json = Json_encode ($ obj); $array = Json_decode ($json, TRUE); $_session[' shopno ']= $array ["Shop"] [' shopno '];$_session[' phone ']= $phone; return $json;} Call function Header ("Content-type:text/html;charset=utf-8"); $moper =$_post[' Oper ']; if ($moper = = "Getshop") {$mresult =getshop ($muname); echo $mresult;}? >
? original link: http://www.rexsee.com/CN/bbs/thread/2012-04-29/556.html