DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C++ (http://www.daniweb.com/forums/forum8.html)
-   -   Connecting to a php file (http://www.daniweb.com/forums/thread160291.html)

FTProtocol Dec 1st, 2008 2:11 pm
Connecting to a php file
 
Hey,

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

Any ideas would be greatly appreciated.

FTProtocol Dec 1st, 2008 3:12 pm
Re: Connecting to a php file
 
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 :(


All times are GMT -4. The time now is 7:25 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC