/    Sign up×
Community /Pin to ProfileBookmark

How is server receive request

Hello all,
I writing a website, it has a function that it will receive request from a application program. When the program sent request to
it, it will receive request and parser request content then sent again response to the program. But I don’t know website will listen request and receive request. Can you help me?
I trying to use $_POST in website to listen and receive request from the program but no success.
My code:
foreach ($_
POST as $key => $value)
{
echo “$_POST”;
}
Thanks,

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@MindzaiOct 19.2009 — You probably mean something like this:

[code=php]
foreach ($_POST as $key => $value) {
echo "$key: $value";
}
[/code]


Or even just:

[code=php]printf("<pre>&#37;s</pre>", print_r($_POST, true));[/code]

If you echo $_POST directly PHP will just print the word Array rather than divulge the contents.
Copy linkTweet thisAlerts:
@hero132authorOct 20.2009 — Thanks MindZai

I sent data from application program that i write by actionscript, it will sent request which is a text file to my webserver,

Code of it is :

var request:URLRequest = new URLRequest( "http://wcc.dyndns.org/ppListen/pp-lis.php" );

// Create some variables to send

var user:String = "admin";

var pass:String = "123456";

var variables:URLVariables = new URLVariables();

variables.someText = "user_active:" + user + ", pass_active:" + pass;

request.data = variables;

sendToURL(request);

request.method = URLRequestMethod.POST


I want my webserver will receive text file and parser it to response to application software. Above, I only echo "$_POST" to test webserver received request content, but it show nothing

I can't how i should process it to receive the request.
×

Success!

Help @hero132 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,
)...