AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Data with sockets (https://forums.alliedmods.net/showthread.php?t=156538)

Clauu 05-08-2011 06:04

Data with sockets
 
Hi,
It is possible to get certain data from a .php file using the sockets module?
For example in a test.php i have:
Code:

$something = "value";
The $something variable i want to get it, can be done it?

ProIcons 05-08-2011 08:56

Re: Data with sockets
 
PHP Code:

$something "value";
if (
$_GET['get'] == "something")
{
   echo 
$something


and in the servers socket

GET /test.php?get=something
...

Clauu 05-08-2011 09:34

Re: Data with sockets
 
Can you please give a working example?

SonicSonedit 05-08-2011 10:23

Re: Data with sockets
 
Clauu
Sockets and webservers

Clauu 05-08-2011 10:40

Re: Data with sockets
 
Yes i know but for some reasons that example is not working properly .. that task - connect_web is returning nothing.

SonicSonedit 05-08-2011 10:48

Re: Data with sockets
 
Clauu
Did you change
PHP Code:

#define SCRIPT_NAME "/myplugin/parser.php" 
#define REMOTE_HOST "myserver.com" //port d.80 

?

Clauu 05-08-2011 10:53

Re: Data with sockets
 
Obviously .. :) Everything is ok the connection is established but nothing is returned.

SonicSonedit 05-08-2011 11:01

Re: Data with sockets
 
That's strange.
Add logging to check what exactly you send. And what exactly returned. Re-check your php file.

Clauu 05-08-2011 11:17

Re: Data with sockets
 
Logging for what ? that plugin is mented to retrieve some data from that .php file.
If i remove the if statement - if (equal(line_variable, "some_value")) this is what i get:
Code:

Value is 200
Value is Sun,
Value is Apache/2.2.9
Value is PHP/5.2.6-1+lenny9
Value is Accept-Encoding
Value is 42
Value is text/plain
Value is text/plain
Value is text/plain

So seems that is an error in the plugin since the connection is ok.

SonicSonedit 05-08-2011 11:28

Re: Data with sockets
 
Traffic log seems ok.
So the problem you don't get any response for your request?


All times are GMT -4. The time now is 04:24.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.