rest - How do I pass value via URL to thia PHP code. -


<?php   require_once ("resthandler.php");  $param=""; if(isset($_get["param"])) {     $param = $_get["param"]; } //var_dump($param);  if(strpos($param,'studentlogin')!==false)   // handling student login requests {     $param = explode("-",$param);            $param = explode(",",$param[1]);         $stuid = explode("=",$param[0]);     $stuid = $stuid[1];     $pass = explode("=",$param[1]);     $pass = $pass[1];      $resthandler = new resthandler();     $resthandler->checkstudentlogin($stuid,$pass);   } else if(strpos($param,'teacherslist')!==false)   {     $resthandler = new resthandler();     $resthandler->getteacherslist();     } else if(strpos($param,'questionslist')!==false)  {     $resthandler = new resthandler();     $resthandler->getquestionslist();    } ?> 

this url vale.

if call works properly. http://localhost/xampp/api/index.php?param=questionslist

response in json

[{"questionid":"1","statement":"how you?"},{"questionid":"2","statement":"what name?"}]

however log in (studentlogin) can't figure out how pass value.

to pass array in url this

http://localhost/path/index.php?param[]=param1&param[]=param2&param[key]=param3&name=name etc.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -