| Code: |
| '===============================================================================
' PostUrlEncoded 1.0 ' By Brent D. Thorn, Aug. 2006 ' Demonstrates posting an HTML form with URL encoding using the WinInet API. ' PUBLIC DOMAIN '=============================================================================== ' Post to <http://www.b6sw.com/forum/search.php?mode=results>. server$ = "www.b6sw.com" page$ = "/forum/search.php?mode=results" formdata$ = FormData$( _ FormInp$( "search_keywords", "wmliberty" )+_ FormInp$( "search_terms", "any" )+_ FormInp$( "search_author", "" )+_ FormInp$( "search_forum", "-1" )+_ FormInp$( "search_time", "0" )+_ FormInp$( "search_fields", "all" )+_ FormInp$( "search_cat", "-1" )+_ FormInp$( "sort_by", "0" )+_ FormInp$( "sort_dir", "DESC" )+_ FormInp$( "show_results", "posts" )+_ FormInp$( "return_chars", "200" )+_ "" ) Open "wininet" For DLL As #wininet Print PostUrlEncoded$( server$, 80, page$, formdata$ ) Close #wininet End |
Subject: [DEMO] Post form URL-encoded
Last edited by Brent on Mar 13th, 2007, 1:11am; edited 4 times in total
The following code is just the "driver" portion of the demo. See below for download link.
Last edited by Brent on Mar 13th, 2007, 1:11am; edited 4 times in total
Subject: Re: [DEMO] Post form URL-encoded
Update: I would have posted this to the LB Conforums' Public Domain board if it weren't so large.
The final release removes the IsLBHandle function because it will not work in LB's debugger. It will always halt when the handle is invalid. I couldn't think of any way around it. I thought I had something special, but it seems LB has a bug with consistency between normal run-time errors and debug-time errors.
The final release removes the IsLBHandle function because it will not work in LB's debugger. It will always halt when the handle is invalid. I couldn't think of any way around it. I thought I had something special, but it seems LB has a bug with consistency between normal run-time errors and debug-time errors.
Subject: Re: [DEMO] Post form URL-encoded
Hello Brent,
There is a small bug in your listing.
A remark is missing somewhere.
Gordon
There is a small bug in your listing.
A remark is missing somewhere.
Gordon
Subject: Re: [DEMO] Post form URL-encoded
Thanks for catching that, Gordon! I had found that and fixed it before trying to post it to Conforums. But when I couldn't post it, I tried trimming it down without luck, so I just restored it (Alt+F, 1, N) and lost the fix.
The original post has this fixed in the code block and download.
The original post has this fixed in the code block and download.
Page 1 of 1
You cannot post new topics in this forumYou cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum