my jquery ajax request is not accessing the the database?

vuthanhlam

New Member
\[code\]jQuery(function ($) { /* fetch elements and stop form event */ $("form.follow-form").submit(function (e) { /* stop event */ e.preventDefault(); /* "on request" */ $(this).find('i').addClass('active'); /* send ajax request */ $.post('recycle.php', { followID: $(this).find('input').val() }, function () { /* find and hide button, create element */ $(e.currentTarget) .find('button').hide() .after('<span class="following"><span></span>Following!</span>'); }); });});\[/code\]the html:\[code\]<form class="follow-form" method="post" action="recycle.php"> <input name="id" value="http://stackoverflow.com/questions/3737379/$id" type="hidden"> <input name="$tweet" value="http://stackoverflow.com/questions/3737379/$tweet" type="hidden"> <button type="submit" value="http://stackoverflow.com/questions/3737379/Actions" class="btn follow" title="123456"> <i></i><span>recyle</span> </button></form>\[/code\]reycle.php:\[code\]<?php session_start();include_once ('includes/connect.php');$id = $_POST['id'];$tweet =$_POST['tweet']; $registerlistener = mysql_query("INSERT INTO notes (user_id, user_note,recyle_id,dt) VALUES('".$_SESSION['user_id']."','".$tweet."','".$id."',NOW()");?>\[/code\]the problem is that it's not accessing the recycle.php file, which inserts the information from the html form into the database! but it's doing the whole jquery animation!! i dont see whats the problem!!!
 
Back
Top