V
V
viktorross2019-05-06 05:41:12
PHP
viktorross, 2019-05-06 05:41:12

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

4 answer(s)
A
Alexander, 2019-05-06
@NeiroNx

Make a sane mobile layout and use webview.

H
HappyMen, 2019-05-06
@HappyMen

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

P
Pavel Druzhinin, 2019-05-06
@CrazyEnimal

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;

Such a php file is essentially an API. True, it does nothing more than check the get parameter. But for an example it is enough.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question