I'm trying to send some data to PHP file but jQuery don't even run my PHP file. Just for the sake of testing I echo some text but I couldn't see any output. This is my code:
jquery :
.
.
.
$("#addFolder").click(function(){
$(".folders").append("<p class='folder'>This is first folder<input type='checkbox' name='checkFolder'></p>");
$data = {'id':document.getElementById('id').value, 'text':document.getElementById('text').value};
$.post('addFolder.php', $data);
});
addFolder.php :
<?php
include 'connect.php';
include 'functions.php';
$id = $_POST['id'];
$text = $_POST['text'];
session_start();
$user = $_SESSION['user'];
$userID = mysql_query("select id from users where username = '$user'")
$iduser = mysql_result($userID, 0)
mysql_query("insert into users_folders values ('$iduser', '$id') where id = '$iduser'") or die(mysql_error());
?>