andys79
asked on
Delphi -> POST -> PHP
Hello,
I wrote an delphi application, that send via NMHTTP
data to the php-script (internet).
The PHP-Script should use this variables, for example
i send an string "test=abc" the script should output
abc ( echo $test)
But the variable is empty. When I send it via ?test=abc the output is right. The POST via Delphi's NMHTTP don't work as I want ...
can anyone help me?
Thanx
Andy
I wrote an delphi application, that send via NMHTTP
data to the php-script (internet).
The PHP-Script should use this variables, for example
i send an string "test=abc" the script should output
abc ( echo $test)
But the variable is empty. When I send it via ?test=abc the output is right. The POST via Delphi's NMHTTP don't work as I want ...
can anyone help me?
Thanx
Andy
ASKER
Hi,
for example to show my problem:
test1.html
-----------
<form name="test" method="POST" action="test2.php">
<input type="hidden" name="helloworld" value="yes">
<input type="submit">
</form>
test2.php
---------
<?php
echo "Skript running ...";
echo $helloworld;
// or: echo $HTTP_POST_VARS["helloworl d"];
?>
=> OUTPUT: Skript running ...yes
-------------
the output is correct.
But when I use this script (test2.php) in Delphi via NMHTTP
NMHTTP1.Post(Edit1.Text, 'helloword=yes');
then I get this:
=> OUTPUT: Skript running ...
(Edit1.Text is the URL of the php-internet-script)
I cannot access to the POST-Variable helloworld, or should I define the POST-Variables in another way in delphi?
Thanx
Andy
for example to show my problem:
test1.html
-----------
<form name="test" method="POST" action="test2.php">
<input type="hidden" name="helloworld" value="yes">
<input type="submit">
</form>
test2.php
---------
<?php
echo "Skript running ...";
echo $helloworld;
// or: echo $HTTP_POST_VARS["helloworl
?>
=> OUTPUT: Skript running ...yes
-------------
the output is correct.
But when I use this script (test2.php) in Delphi via NMHTTP
NMHTTP1.Post(Edit1.Text, 'helloword=yes');
then I get this:
=> OUTPUT: Skript running ...
(Edit1.Text is the URL of the php-internet-script)
I cannot access to the POST-Variable helloworld, or should I define the POST-Variables in another way in delphi?
Thanx
Andy
I believe that there's a problem with
NMHTTP1.Post(Edit1.Text, 'helloword=yes');
try
NMHTTP1.Get(Edit1.Text, 'helloword=yes');
if it exists :)
I don't know delphi
NMHTTP1.Post(Edit1.Text, 'helloword=yes');
try
NMHTTP1.Get(Edit1.Text, 'helloword=yes');
if it exists :)
I don't know delphi
ASKER
It doesn't work ...
(Too much parameter) ;-((
(Too much parameter) ;-((
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Can a webserver accept posts from another application or is there a security mechanism?
ASKER
Can a webserver accept posts from another application or is there a security mechanism?
Sorry, I was in holiday ..
Sorry, I was in holiday ..
Yes, as far as it's concerned, it is just another browser.
The example I show above works. I wrote a PHP program
just as you did and used the Delphi source above to
retrieve the value from the server.
The example I show above works. I wrote a PHP program
just as you did and used the Delphi source above to
retrieve the value from the server.
I don't know NMHTTP, but I think it should work if NMHTTP support the post method