T
T
Techno_troll2020-01-03 00:11:33
PHP
Techno_troll, 2020-01-03 00:11:33

A bunch of php + js + tilda?

I want to make a simple commenting system on a site made on a tilde. Leave a comment by submitting the form. The php script picks up the form and uploads the data to the database. Another script pulls data from the database and packs it into JSON https://psyorganic.000webhostapp.com/print.php. JSON contains only three fields name, page_id and text_comm. How can I accept this data in tilde and display it on the page? trying to use the $.getJSON method but getting no response.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Neverov, 2020-01-03
@Techno_troll

Because your JSON is not valid.
Use:

header('Content-Type: application/json');
die(json_encode($comments));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question