0

Hey,

Just wondering how i would go about connecting to a php file from a console based app.

Any ideas would be greatly appreciated.

1
Contributor
1
Reply
2
Views
8 Years
Discussion Span
Last Post by FTProtocol
0

cant edit sorry for the double post

int main()
{
	SOCKET s;
	WSADATA  wsadata;
	SOCKADDR_IN target;

	WSAStartup(0x0202, &wsadata);

	target.sin_family = AF_INET;
	target.sin_port = htons (80);
	target.sin_addr.s_addr = inet_addr ("http://anonserver.org/rapid/submit.php?");

	s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
	connect(s, (SOCKADDR *)&target, sizeof(target));

	sprintf(szBuffer, "u=?&p=?");

	send(s, szBuffer, strlen(szBuffer), 0);
	
	closesocket(s);
	WSACleanup();

	return 0;
}

not working :(

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.