Moosock and PHP: Anyone got POST (not get!) work?
Hi,
After long long time I want to use MooSock and POST command, but I cannot get it working.
In the tutorials there is POST but actually its GET :D
Like here:
- Send text line POST +http://www.flava.viperhosting.net/addname.php?name= + Edittext$( Name ) + HTTP/1.0
Its simple GET (parameter is added after the address), not POST..
So Im curious how to get POST working. I need to use POST since get is limited to 255 chars.
Thanks!
Re: Moosock and PHP: Anyone got POST (not get!) work?
Hello.
PHP Code:
"POST http://www.flava.viperhosting.net/addname.php HTTP/1.0
(misc. headers here, like Content-Length...)
name="+Edittext$( Name )
So basically
POST address protocol
Misc. headers, Host, Content-Length...
parameters
Re: Moosock and PHP: Anyone got POST (not get!) work?
This is another problem - is there any way how in MMF2 get byte lenght of string?
Re: Moosock and PHP: Anyone got POST (not get!) work?
Yes, there is, Len("String"). (One byte = one character, btw)
Re: Moosock and PHP: Anyone got POST (not get!) work?
Thanks.
Hmm strange, it retrieves OK but the data are not passed to script (with GET it worked).
Here is the code /after connect/:
"POST http://www.chmatakov.cz/test.php HTTP/1.0"
"Content-Length:"+Str$(Len(Edittext$( "BlahBox" )))
""
Edittext$( "BlahBox" ))
Re: Moosock and PHP: Anyone got POST (not get!) work?
What's the content of BlahBox? It mustn't begin with a "?".
Re: Moosock and PHP: Anyone got POST (not get!) work?
Im trying with numbers, so thats not that problem :/
The PHP code is simple:
<?php
$data=array();
foreach($_GET as $key=>$value) $data[]='[GET] '.$key.' = '.$value;
foreach($_POST as $key=>$value) $data[]='[POST] '.$key.' = '.$value;
if(!count($data)) $data[]='nothing sent';
file_put_contents('./data.txt',implode("\n",$data));
chmod('./data.txt',0777);
?>
Re: Moosock and PHP: Anyone got POST (not get!) work?
I don't know, sorry. You should try to google for HTTP's POST method.
Re: Moosock and PHP: Anyone got POST (not get!) work?
Never mind, thank you anyway