John Smith John Smith - 2 months ago 18
PHP Question

Accessing Data sent with JQuery AJAX with PHP

I am trying to make a shopping web platform and I use for every product a template that changes its data with data sent by AJAX post method.

$(".anunt .title").each(function() {
$(this).click(function() {
title: $(this).html()
}, function() {


<div id="postare">
echo json_encode($_POST['title']);

The error is: Undefined Index: title.
What am I doing wrong?

Answer Source

Maybe you should use the header tag to be able to access the variable from the other file.