Author Topic: How would one properly send a variable using TCP?  (Read 1167 times)

So I have all my TCP objects and functions set up. but when I use this:
Code: [Select]
BLConnectTCP.message = "GET /index.php?IRC=SEND%20" @ $Pref::Player::NetName @ "%20:%20" @ %text @ " HTTP/1.0\r\nHost: www.blocklandconnected.com\r\n\r\n";

It just returns the pages source code.
And the .message is not a real function, it's a variable that's used later on in the code.

And yes I've tried using POST instead of GET but that just returns a 406 error and the PHP is set to wait for a client then once a message is sent, it broadcasts it.

The ?IRC variable contains the message sent from the GUI, it doesn't even return the message when it returns all the source code.

Any suggestions?

If you're using PHP and your page just returns it's source code, your webserver does not support PHP (or it isn't enabled).

I don't understand why you're formatting your data transmissions in a human readable format.

I don't understand why you're formatting your data transmissions in a human readable format.
Every tutorial I've seen shows it like that why, is there a different way?

No, the actual transmission is in the proper format. I meant the variable you're sending. "SEND tetronaught : hello" is not the most efficient way to send that message.

Also, PHP is quite possibly the worst possible language to write an IRC server in.

You might need to set content-type and content-length.

Also, variables should go after the header.

That's true in a POST request, but in a GET request the data is part of the URL so there technically is no content.

If he's sending a message, he should be using POST anyway.


How do you expect to receive messages? From the looks of the previous topic where you asked how to send data, you're just establishing on-the-fly connections for every piece of data you want to send.

Also, PHP is quite possibly the worst possible language to write an IRC server in.
^ I've done it before not fun

Personally I would have the file on the server be a .cs or have the php script write to a cs file
Shhhhhhh. this never happppeennnd
« Last Edit: February 15, 2014, 01:32:07 PM by RarwMuffinz »

Personally I would have the file on the server be a .cs or have the php script write to a cs file
what?

Disregard anything I sent from my iPad around midnight last night