AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [sockets] login to site (https://forums.alliedmods.net/showthread.php?t=130792)

Empowers 06-27-2010 14:52

[sockets] login to site
 
I want to login(enter email & password) to this site http://cp.gaming-service.com via sokets.

I have this link it enters email and password:
Code:

http://cp.gaming-service.com/login.php?email=test%40gmail.com&password=mypassword123
But how can i press enter key?

joropito 06-27-2010 14:57

Re: [sockets] login to site
 
Quote:

Originally Posted by Empowers (Post 1221708)
I want to login(enter email & password) to this site http://cp.gaming-service.com via sokets.

I have this link it enters email and password:
Code:

http://cp.gaming-service.com/login.php?email=test%40gmail.com&password=mypassword123
But how can i press enter key?

Check this out, may it helps you

http://forums.alliedmods.net/showthread.php?t=117744

http://forums.alliedmods.net/showthread.php?t=117748

http://forums.alliedmods.net/showthread.php?t=116095

Empowers 06-27-2010 15:27

Re: [sockets] login to site
 
Nice tuts man :) But for me steel doesn't work ;( help me pls

PHP Code:

        socket5 socket_open("cp.gaming-service.com"80SOCKET_TCPerror)
        if(
socket5 0)
        {
            
formatex(plaincharsmax(plain), "[email protected]:mypassword123")
            
encode64(plainencodedcharsmax(encoded))
            
            
formatex(requestcharsmax(request), "GET /servermanage.php?task=restart&serverid=24 HTTP/1.0^n")
            
formatex(request2charsmax(request2), "%sHost: cp.gaming-service.com^n"request)
            
formatex(requestcharsmax(request), "%sAuthorization: Basic %s^n"request2encoded)
            
formatex(request2charsmax(request2), "%sUser-Agent: %s - %s - %s^n^n"requestPLUGIN_NAMEPLUGIN_AUTHORPLUGIN_VERSION)
            
socket_send(socket5request2charsmax(request2))
            
server_print("%s",request2)
        } 


joropito 06-27-2010 15:29

Re: [sockets] login to site
 
But you're not sending your email/password in your code

xPaw 06-27-2010 15:38

Re: [sockets] login to site
 
you gotta send POST headers

Empowers 06-27-2010 15:46

Re: [sockets] login to site
 
Quote:

Originally Posted by joropito (Post 1221768)
But you're not sending your email/password in your code

PHP Code:

// i encode it
formatex(plaincharsmax(plain), "[email protected]:mypassword123"
encode64(plainencodedcharsmax(encoded)) 
             
            
//and then parse on this line
            
formatex(requestcharsmax(request), "%sAuthorization: Basic %s^n"request2encoded

Whats wrong with that?

joropito 06-27-2010 15:52

Re: [sockets] login to site
 
Quote:

Originally Posted by Empowers (Post 1221799)
PHP Code:

// i encode it
formatex(plaincharsmax(plain), "[email protected]:mypassword123"
encode64(plainencodedcharsmax(encoded)) 
             
            
//and then parse on this line
            
formatex(requestcharsmax(request), "%sAuthorization: Basic %s^n"request2encoded

Whats wrong with that?

Right but in your example (first post) you show user/pass as parameters and not as http authorization challenge.

Empowers 06-27-2010 15:55

Re: [sockets] login to site
 
Quote:

Originally Posted by joropito (Post 1221807)
Right but in your example (first post) you show user/pass as parameters and not as http authorization challenge.

ahh my English, can u give a little example how to do it correct please :cry::cry::cry:

joropito 06-27-2010 15:59

Re: [sockets] login to site
 
You should use POST as method and the correct url is /process.php
Then add the parameters as POST variables.

Try to read an http protocol tutorial to understand how to do it

http://www.jmarshall.com/easy/http/#othermethods


EDIT:

You need to edit you HTTP REQUEST (POST blahblah HTTP/1.0^nHost: blabla^n^nvariable=dasd&variable2=value2^n^n)

Empowers 06-27-2010 16:02

Re: [sockets] login to site
 
Code:

http://cp.gaming-service.com/[email protected]&password=password123&task=login
if i enter that to my browser it says wrong password or email even if its ok. Why is that so?

Quote:

Originally Posted by joropito (Post 1221819)
You should use POST as method and the correct url is /process.php
Then add the parameters as POST variables.

Try to read an http protocol tutorial to understand how to do it

http://www.jmarshall.com/easy/http/#othermethods

Oh god ;( my english is very pour i understand only part of words there, can you please give me a small example how should I do that. pleasseee man


All times are GMT -4. The time now is 14:55.

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