Raised This Month: $ Target: $400
 0% 

sending data to php script


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 07-18-2007 , 21:16   Re: sending data to php script
Reply With Quote #7

Quote:
Originally Posted by hackziner View Post
Lol, I'll sum up my previous post

GET request is easier than POST

You have to open a TCP connection to the host

new socket = socket_open( "http://www.amxmodx.org"", 80, SOCKET_TCP, error );

You have to format a GET request

formatex( buff, 1023, "get http://forums.alliedmods.net/showthread.php?t=58038^r^n" );

t is a variable and 58038 the value of t

send the request

socket_send( socket, buff, 1024);

define a task to get the page

if (socket_change( socket) //check if there is something waiting in the socket
socket_recv( socket, buff, 1023) //put the socket in buff


If you wanna try if you php page works, just open telnet, type the request and see the result ...
I understand little to none about sockets and php and this helped alot. But I was thinking to send it
to the main php script. How would I send the message using sockets like the code in my first post.

This is where I want to send my message and get the result from $result.
PHP Code:
class sendMsg
{
 var 
$_msg;
 var 
$result;
 
 function 
sendMsg($message)
 {
  
$this->_msg $message;
 } 
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:26.


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