C
C
colorkid2016-11-02 14:57:05
PHP
colorkid, 2016-11-02 14:57:05

How to send data to the server by mail form, edit JSON file?

Hello. I am completely 0 in php and other server matters, so I don’t even know how to approach the task.
As planned, there will be a page on which there will be a form for sending to the data server. Based on these data, the json file will be edited. You will also need to remove from this file.
A file of this type,
[
{
"category": "moykistal",
"name": "Polygran F-05 washer",
"price": 2990,
"preview": "img/f05beige-min.png",
"photos":
[
"f05beige-min.png",
"f05black-min.png",
],
"description": "Any, absolutely any text, of course it's better, whatever it is text, of course it's better, absolutely any text, of course it's better whatever it is and absolutely any text, of course it's better if it's information about you, absolutely any text, of course it would be better if it was re"
},
{
"category": "moykikamen",
"name": "Polygran F-11 sink",
"price": 5600,
"preview": "img/f05green-min.png",
"photos":
[
"f05green-min.png",
"f05beige-min.png",
"f05pink-min.png",
"f05black-min.png"
],
"description": "Not any but important text"
}
]
As you can see, each form submission should create a product with the corresponding values. How to do it? How to generally edit json files on the server through submitting forms? Is it possible?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
Zlatoslav Desyatnikov, 2016-11-02
@pxz

Understand the basics first.
1. Basics of PHP syntax
2. Working with HTTP and requests ( POST, GET )
3. Working with JSON in PHP
In general, here you need to use a database for storing goods, MySQL, for example, and not a JSON file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question