Jump to content

HTTP POST.


Recommended Posts

I am trying to do an HTTP POST but I believe I am doing somehting wrong. I used HTTP Analyzer V2 to sniff out all data to be posted to a website, however I can not seem to get anything to work. It keeps saying I am using "GET" and not POST, but microsoft said doing it this way will post.

Based on these 3 sites:

http://support.microsoft.com/kb/311293/EN-US/ http://msdn.microsoft.com/library/default....ds/navigate.asp

http://support.microsoft.com/kb/165298/EN-US/

Maybe I am doing something wrong? I know 99.99% percent sure the POST data is correct. I was able to emulate a POST using external software, I used the same POST data and headers.

#include <IE.au3>
#include <Inet.au3>

$Header = "Content-Type: application/x-www-form-urlencoded" 
$FormURL = "http://www.imvu.com/catalog/web_registration.php"
    $o_IE = _IECreate ("about:blank",1,1)
    $o_IE.navigate ("http://www.imvu.com/catalog/web_registration.php?action=register", 0, 0, 0, $Header)
    _IELoadWait ($o_IE)
    $HTML = _IEBodyReadHTML ($o_IE)
    $Code = StringRegExp($HTML, "thecode"", '(.*?)', ""ENTRY_HUMANCHECK_ERROR", 3)
    If @extended Then 
        $RandomName = GenerateRandomName()
        $PostData = "action=process&avatarname=" & $RandomName & "&password=default123&confirmation=default123&tagline=Heyyyy%21+I%27ll+fill+this+out+later+%3A%29&email_address=paroxsitic%2B" & $RandomName & "@gmail.com&dob_month=06&dob_day=04&dob_year=1985&country=223_MI&thecode=" & $Code[0] & "&userId=227598"
        $o_IE.navigate($FormURL, 0, 0, $PostData ,$Header)
    EndIf

Func GenerateRandomName()
    Local $Let1 = Chr(Random(Asc("a"), Asc("z"), 1))
    Local $Let2 = Chr(Random(Asc("a"), Asc("z"), 1))
    Local $Let3 = Chr(Random(Asc("a"), Asc("z"), 1))
    Local $Let4 = Chr(Random(Asc("a"), Asc("z"), 1))
    Local $Let5 = Chr(Random(Asc("a"), Asc("z"), 1))
    Local $Let6 = Chr(Random(Asc("a"), Asc("z"), 1))
    Local $Let7 = Chr(Random(Asc("a"), Asc("z"), 1))
    Return $Let1 & Random(1, 9, 1) & Random(1, 9, 1) & $Let2 & $Let3 & Random(1, 9, 1) & $Let4 & $Let5 & $Let6 & Random(1, 9, 1) & Random(1, 9, 1) & $Let7
EndFunc
Link to comment
Share on other sites

A more simple example:

http://www.tizag.com/phpT/examples/formexample.php

#include <IE.au3>

$Header = "Content-Type: application/x-www-form-urlencoded" 
$FormURL = "http://www.tizag.com/phpT/examples/formexample.php"
$o_IE = _IECreate ("about:blank",0,1)
$PostData = "Fname=fdf&Lname=cxzczc&gender=Male&food%5B%5D=Steak&food%5B%5D=Pizza&quote=Enter+your+favoriteccc+quote%21&education=College&TofD=Day&submit=submit"
$o_IE.navigate($FormURL, 0, 0, $PostData ,$Header)

Tommorrow I'll try using InternetOpen, InternetConnect, and HTTPRequest instead of navigate and see if that helps any.

Edited by ParoXsitiC
Link to comment
Share on other sites

  • 1 year later...

Hmmm.. im also trying to post queries into php files but im to lazy to create a script..

If u manage to create one could you send a copy to me :)?

and i have also made a script that searches a html/php file for queries and returns what commands you can post in the php/html file.. but.. i lost it somewhere :S

Edited by Chris86
Link to comment
Share on other sites

  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...