Answer the question
In order to leave comments, you need to log in
How to make an application for the site?
Hello, please tell me how to make an application for the site? The site works on PHP and Smarty, I heard that you can just take data from the site via api, so how to create it? why should it be created? to php functions or template? could you send an example of how it works? I want to try cordova, but it's also not clear on what basis to create an application on it
Answer the question
In order to leave comments, you need to log in
Do with all the methods and functions of the server side of the script. And submit it in the design in the application by making a request to the api and displaying the necessary information. In general, this is a purely individual matter. You can apply to freelance sites
Api site, there is nothing more than a site page that does not work on outputting HTML code, but on outputting, for example, JSON or XML, and when requesting such a page, you usually need to specify a GET or POST request. For example, the form handler is part of the site's API. To summarize: If we can access a page with a GET or POST request and get the data, then this can be called an api.
Example:
<?php
header('Content-Type: application/json');
$answer = new StdClass();
if($_GET['response'])
{
$answer->success = true;
$answer->message = 'Message: '.$_GET['response'];
} else {
$answer->success = fail;
$answer->error = true;
$answer->message = 'No GET Params';
}
$json = json_encode($answer);
echo $json;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question