rastaman46 Posted July 6, 2012 Share Posted July 6, 2012 got this code but struggling to get php side working dont know how php have to look like please help or advise me thanks!!! $('#create_shout').submit(function(e) { e.preventDefault(); var $message = $.TSUE.urlEncode(tinyMCE.activeEditor.getContent()); if($message === '') { $.TSUE.alert(TSUEPhrases['message_required_fields_error']); return false; } buildQuery = 'action=create_shout&message='+$message+'&securitytoken='+TSUESettings['stKey']; $.ajax( { url:TSUESettings['website_url']+'/ajax/shoutpost_ajax.php', data: buildQuery, success: function(serverResponse) { if(!$.TSUE.findresponsecode(serverResponse)) { $.TSUE.alert(TSUEPhrases['message_posted']); $.TSUE.jumpInternal('?p=shoutpost&pid=502'); return false; } else { $.TSUE.dialog(serverResponse); } } }) }); and php function create_shout(){ $date = TIMENOW; $memberid = $TSUE['TSUE_Member']->info['memberid']; $message = addslashes($_POST['message']); $add = $TSUE['TSUE_Database']->query("INSERT INTO `rasta_shout_post`(`sid`, `date`, `memberid`, `message`) VALUES ('','$date','$memberid','$message')"); } Quote Link to comment https://forums.phpfreaks.com/topic/265332-jquery-ajax-hellp-needed-or-advice/ Share on other sites More sharing options...
rastaman46 Posted July 7, 2012 Author Share Posted July 7, 2012 Any one? Quote Link to comment https://forums.phpfreaks.com/topic/265332-jquery-ajax-hellp-needed-or-advice/#findComment-1359841 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.