U
U
Uniq2018-02-01 07:52:42
PHP
Uniq, 2018-02-01 07:52:42

Choosing to submit data from json or form-data forms?

The question arose for processing data on the server:
if you accept $_POST $_GET parameters from forms or js handlers in json format, what could be the consequences?
how will json_decode react if they send all kinds of horror (not in json format)?
Frontend I want to change to Angular and backend to leave php

json_decode(file_get_contents('php://input')) // Получение json

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2018-02-01
@alexey-m-ukolov

if you accept $_POST $_GET parameters from forms or js handlers in json format, what could be the consequences?
If you do not screw up with the code, then none.
how will json_decode react if they send all kinds of horror (not in json format)?
Documentation .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question