/    Sign up×
Community /Pin to ProfileBookmark

PHP can not get value from Ajax post

Hi All

I’m working on FullCalendar and I want to send request to a php page via ajax the problem is Ajax sends the request I can see it via Developers Tools and alert it is as expected but the PHP page the value is null I can not understand why ???

[CODE]
eventClick: function(event, jsEvent) {

$(“#eventID”).val(event.id);
event.id = $(‘#eventID’).val();

$.ajax({
url: ‘http://localhost/CRM/calUserList.php’,
data: ‘id=’+ event.id,
type: “POST”,
success: function(json) {
alert(‘id=’+ event.id);
}

});[/CODE]
[code=php]$id = $_POST[‘id’];
echo $id;
var_dump ($_POST);[/code]
[code=html]<input id=”eventID” type=”text”>[/code]

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @zed420 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.26,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...