function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mbbendermbbender 

Accessing requestData in PHP

I'm trying to just setup a simple connection between my javascript S-control and a hosted php script. I'm using the AJAX proxy example.

I'm having troubles accessing the requestData information in PHP. Can anyone provide the PHP code needed to access the "hello world" string?

Once I access the "hello world" string I'll move to sending JSON objects so if you can provide any color around that as well it would be greatly appreciated.

Thanks.

JavaScript S-Control:
sforce.connection.remoteFunction(
{
url: "http://subdomain.mydomain.com/mbbtest.php",
requestHeaders: {"Content-Type": "text/plain"},
mimeType: "text/plain",
requestData: "hello world",
method: "POST",
onSuccess: function(response) {
sforce.debug.log("success: "+response);
},
onFailure: function(response) {
sforce.debug.log("failure: "+response);
}
}
);



PHP Code that does not work
<—php
error_log("----------------");
error_log($_REQUEST['requestData']);
–>