Home AMX User Forum AMX Technical Discussion

HTML Programming

How do I post data to a Webpage that requires authentication. It is a simple Username and Password?

I can get the port open using port 80 but after that I am lost.

Any help would be greatly appreciated.

Thanks in Advance

Troy

Comments

  • viningvining Posts: 4,368
    You can use WireShark to look at the communications back & forth from a PC and the website and use what you learn there in your code. You could also just put a send_string 0 in the string event handler to print what the web server sends you. Once you open the connection it should send a prompt. Then add to your code to respond to the prompt and see what happens next, back & forth, try & try again.

    There's a bunch of examples here on the forum that you can search for and probably similar working code in the modperia section. See what you can find and when you get stuck post the code you have so far and your problems.
  • DHawthorneDHawthorne Posts: 4,584
    Unfortunately, there is no set answer, since every web site is different. You will definitely need some manner of header information which would include the login, if required. Vining's suggestion will help you with this, and a Google search for HTTP protocol standards will help you understand what you see.
  • the8thstthe8thst Posts: 470
    vining wrote: »
    You can use WireShark to look at the communications back & forth from a PC and the website and use what you learn there in your code. You could also just put a send_string 0 in the string event handler to print what the web server sends you. Once you open the connection it should send a prompt. Then add to your code to respond to the prompt and see what happens next, back & forth, try & try again.

    There's a bunch of examples here on the forum that you can search for and probably similar working code in the modperia section. See what you can find and when you get stuck post the code you have so far and your problems.

    Another (and possibly easier) method is to install FireBug on Firefox. This will allow you to see and track all of the communication between the webbrowser and the webserver.
  • mpullinmpullin Posts: 949
    the8thst wrote: »
    Another (and possibly easier) method is to install FireBug on Firefox. This will allow you to see and track all of the communication between the webbrowser and the webserver.

    Actually, I would recommend LiveHTTPHeaders (http://livehttpheaders.mozdev.org) for this. FireBug is also a great tool, which everyone should install, but LiveHTTPHeaders is a lot simpler if you just need to see HTTP transactions.
Sign In or Register to comment.