Bay Six Software Forum Index Bay Six Software
Beyond the Basics
 
 FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[DEMO] Post form URL-encoded

 
Post new topic   Reply to topic    Bay Six Software Forum Index -> Internet Programming
View previous topic :: View next topic  
Author Message
Brent
Site Admin


Joined: 01 Jul 2005
Posts: 797

PostPosted: Aug 15th, 2006, 4:53am    Post subject: [DEMO] Post form URL-encoded Reply with quote

The following code is just the "driver" portion of the demo. See below for download link.
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



PostUrlEncoded.zip
 Description:
Full demo code

Download
 Filename:  PostUrlEncoded.zip
 Filesize:  3.63 KB
 Downloaded:  640 Time(s)


_________________
Brent


Last edited by Brent on Mar 13th, 2007, 5:11am; edited 4 times in total
Back to top
View user's profile Send private message Send e-mail
Brent
Site Admin


Joined: 01 Jul 2005
Posts: 797

PostPosted: Aug 20th, 2006, 4:41am    Post subject: Re: [DEMO] Post form URL-encoded Reply with quote

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.

_________________
Brent
Back to top
View user's profile Send private message Send e-mail
Gordon
Guest





PostPosted: Aug 20th, 2006, 11:06pm    Post subject: Re: [DEMO] Post form URL-encoded Reply with quote

Hello Brent,

There is a small bug in your listing.

A remark is missing somewhere.

Gordon
Back to top
Brent
Site Admin


Joined: 01 Jul 2005
Posts: 797

PostPosted: Aug 21st, 2006, 2:23am    Post subject: Re: [DEMO] Post form URL-encoded Reply with quote

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.

_________________
Brent
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Bay Six Software Forum Index -> Internet Programming All times are GMT
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You 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



Lo-Fi Version
Powered by phpBB © 2001, 2005 phpBB Group