I'm using the following in my javascript:
jQuery.post( "cmssave.php" , html_to_send , done_edit() , "html" )
And on the PHP end I'm trying to get the posted data using:
$data = $_POST['somevar']
The problem is (I assume) I can't find what post variable is being used.
When I do var_dump($_POST)
I get exactly (in my logs): , referer: http://blablabal
However, when i use: print_r( $_REQUEST, true )
I see all my html that has been sent.
I've tried using the following to get the correct data out:
$_POST , $_POST[''] , $_POST[0] , $_POST["data"] , $_POST['html_to_send']
But I get nothing. Am I missing something, or do I need to somehow assign that variable in the javascript? If that's the case how would I do that?
You can define the post variable you want to use in jquery like this:
var data = {
somevar: 'my post value'
}
jQuery.post( "cmssave.php" , data, done_edit , "html" );
Further you might want to assing the success-function (done_edit) without parentheses, otherwise you would call the success function and assing it's return value.
And in PHP you get the value like this:
$data = $_POST['somevar'];
echo $data;
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
I want to have multiple links that will use Fancybox but I want to be able to set the width and height for the iframe popup
I want to use JavaScript to perform a POST request using the common "Authorization: Basic" methodThe server hosts an OWIN C# App and on successful authentication it should give me a token in JSON format
I am using a jQuery based WordPress Twitter widget and receive the error "ReferenceError: _ is not defined"
I am working on a little script that hides the navigation when you scroll down and shows the navigation when scroll up