mysql - AJAX/PHP send values to server -


I am trying to use AJAX to send values ​​to a PHP file, which then updates mysql database on the server But for some reasons the value has not been transferred to the PHP file.

This JS I use:

  function send_message () {var number = localStorage.getItem ("number"); Var message = sign ("message:", ""); JQuery.ajax ({type: "POST", url: serviceURL + "message.php", data: 'number =' + + + '& amp; message =' + message, cache: wrong, success: function (feedback) {Alert ("Message begging")}}}); }   

and this is message.php

    

Everything else is inserted on mysql except for the number and the message. What could be the reason for this?

You are posting data with AJAX using the post. To listen to those values ​​in PHP, ...

Change:

  $ number = $ _GET ['number']; $ Message = $ _GET ['message'];   

with:

  $ number = $ _POST ['number']; $ Message = $ _POST ['message'];    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -