N
N
Nikita2015-06-16 15:04:10
PHP
Nikita, 2015-06-16 15:04:10

How to add content management to html page?

There is a landing page (in html), on which, as an example, 20 products are posted.
You need to add the ability to change the status ("in stock" "out of stock").
How can this be done without full stretch on cms?

Answer the question

In order to leave comments, you need to log in

8 answer(s)
A
Alexander Shapoval, 2018-09-06
@santavits

$orderapi = 7690218;
$result = json_decode('{"orders":{"7690218":{"id":"7690218","obj":"wall35173603_613","act":"vk_like","status":"works","timeout":"10","count":"5","count_good":"0","start":"16:21 06.09.2018","criterion":"no"}}}');
$status = $result->orders->$orderapi->status; // works
$count_good = $result->orders->$orderapi->count_good; // 0

S
Stimulate, 2018-09-06
@Stimulate

echo '<pre>';
print_r(json_decode($orderapi));
echo '</pre>';

I
Igor, 2018-09-06
@m0pfin

$details = json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip={$ip}"));
$city = $details->{'geoplugin_city'}; // Город
$region = $details->{'geoplugin_region'}; // Регион
$country = $details->{'geoplugin_countryCode'}; // Код страны

For example
$details = json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip={$ip}"));
echo $details;

Look at what just gives Json_decode and what I rip out, and you will understand how
PS works in the $ip variable, do not put the IP in

P
Pavel, 2018-09-06
@Pavel333

You can add a true flag to the json_decode($json, true) function. Then you will get a set of nested arrays, respectively, you can extract data through square brackets, and not property calls from objects. You can also use the foreach loop and other array functions.
An example from Alexander Shapoval would look like this:

$orderapi = 7690218;

$result = json_decode('{"orders":{"7690218":{"id":"7690218","obj":"wall35173603_613","act":"vk_like","status":"works","timeout":"10","count":"5","count_good":"0","start":"16:21 06.09.2018","criterion":"no"}}}', true);

$status = $result['orders'][$orderapi]['status']; //works
$count_good = $result['orders'][$orderapi]['count_good']; //0

S
SabCoopers, 2015-06-16
@nikita0509

Ideal option: textolite.ru

D
Dmitry Krivoshein, 2015-06-16
@kdes70

you can use php
to define a variable
$var = $var ? в наличии : нет в наличии

T
trevoga_su, 2015-06-16
@trevoga_su

drive all the information about the goods into the DBMS through phpmyadmin. the easiest and cheapest option. and output in a loop.
and banal CMS and presentation logic can be hung up

P
ppskmg, 2019-06-09
@ppskmg

If in general terms:
1. file where we store the list of goods
2. Landing
3. Where we manage the status
We hook a script that checks the status of the goods in file No. 1 and displays the status in No. 2. We change the status in No. 3 and save the value in No. 1.
Storage can be google spreadsheets, html, mysql, crm, etc. depending on skills.
Most often, small php/js scripts are written on landing pages that check the statuses in crm. and send requests.
And so try (tilda.cc) or the like out of the box like that.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question