Tuesday 15 September 2015

api - PHP Session without Cookies | Codeigniter -


landscape

I am working on a particular type of API Which uses SMS for the call
User SMS & lt; APP NAME & gt; Like send SMS & Lt; Parameter & gt;
An entrance door 9888888888. Now the gateway server contacts this app's API (which is my app in this case) in this format. Http : //myapi.com/myapp/api.php? MobileNo = 912345678 & amp; userInput = & lt; PARAMETERS & gt;

Problem

When I'm new to the user, I show a welcome message and it will have 1 option such as & gt; 2 Signup & gt; Help 3 & gt; Suppose something else answers to 1 or 2 or 3 . The entrance will send me a request such as <<> http://myapi.com/myapp/api.php?mobileNo=912345678&userInput=1
This means that the user wants to register But how do I tell the server like this? This will be easier than coding for every page for every page $ _ GET ['userInput'] == 1 and so on, but the problem occurs when you have other parts of the app Use. Like I'm asking a user to give 1 answer if he wants to do a certain job. How, in this case, to register the server judge or to that job?

How will I judge what the user wants when only one parameter is given to me, for example, I have two pages, one where the user answers with 1 where it is something else some other page Wants to include on where the user answers 1 when he wants to contact me

User process Database-bases for where to find For example, consider the table:

  create tab 'mobile_session' (`mobile_number` VARCHAR) (10) tap primary key,` phase` tinet (2) tap );   

The user has been assigned an internal identifier to each potential group of inputs, for example your registration page1, contact page 2, etc. Whenever a user contacts you, update the database with your mobile number and group of inputs of those groups coming back. For example, if 1 is your registration page.

  Change to `mobile_session` values ​​([[user phone number]], '1');   

Then when you receive a request like this:

  http://myapi.com/myapp/api.php?mobileNo=912345678&userInput= 1   

You can see that phone number in the table that the user is responding to the type of input, in this case you will know that the user is responding to the registration page. .

No comments:

Post a Comment