Re: How would I get data from a php script?
I think it depends on the get/post method that you're using, or some other small factor - it's definitely possible to get a plain PHP script to return a simple easily-parsed string without having to pare off a heap of tags, as the tutorial covers that.
Re: How would I get data from a php script?
I'm fairly sure you get a plain return if you use "GET /file.php" without a http version number or headers. It's a left-over from http 0.9 iirc and web servers don't all support it, so it's kind of stupid to use.
Re: How would I get data from a php script?
Oh... should I change it then? Or not as it's already working on my web server?
Re: How would I get data from a php script?
Re: How would I get data from a php script?
I hope not, as I've just taught people to use something remarkably similar.
Re: How would I get data from a php script?
Quote:
Originally Posted by Steven
Is that code not right then?
Doesn't look right to me. It never connects, and for some reason it attempts to host a server. If I were coding it, it'd also fully adhere to the HTTP 1.1 standard. I'm sure there are many examples on the old CT forum at least.
Re: How would I get data from a php script?
I see a listen command up above, I have never needed that to send or recieve from a PHP page using MooSock.
Re: How would I get data from a php script?
Quote:
Doesn't look right to me. It never connects, and for some reason it attempts to host a server.
Quote:
I see a listen command up above, I have never needed that to send or recieve from a PHP page using MooSock.
How comes it works in my game? :confused: It actually works flawlessly. I've heard that some people have lots of trouble with Moosock, but I haven't had 1 after following DavidN's tutorial.
Would you guys like to upload a .mfa of it working? Might help me to see if it works on everyones PC.
Re: How would I get data from a php script?
Quote:
Originally Posted by Joshtek
Quote:
Originally Posted by Steven
Is that code not right then?
Doesn't look right to me. It never connects, and for some reason it attempts to host a server. If I were coding it, it'd also fully adhere to the HTTP 1.1 standard. I'm sure there are many examples on the old CT forum at least.
I'm quite familiar with networking terminology. Listening on a port means that your application is waiting for another computer to connect to yours on that port, just like a server program. So that line is completely unnecessary.
Re: How would I get data from a php script?
It seems that's right - I saw that in the first MooSock tutorial I ever read and just assumed that it meant "wait for a response coming back on port 80". This requires quite a major edit.