[Zope] sending form data offsite SOLVED!

Ed Colmar ed@greengraphics.net
Wed, 12 Mar 2003 20:52:37 -0800 (PST)


Thanks again for all the tips!

Heres what I ended up with for anyone else trying to do the same thing:

--------------

I made an external method:

def formsender(self, url, params):
    """ This method is used to transparently send form data to an external
server """
    import urllib
    encodedParams = urllib.urlencode(params)
    print url
    print encodedParams
    try:
        result = urllib.FancyURLopener().open(url, encodedParams)
        urllib.FancyURLopener().close()
        return result.read()
    except:
        return 0


---------------

Then in dtml I placed this code on the page that the form points to:

<dtml-call "REQUEST.set('params', REQUEST.form)">
<dtml-call "REQUEST.set('url','http://www.whateversite.com/cgi?')">
<dtml-var "formsender(url, params)">



---------------

-ed-





-- 
Green Graphics   :::   Print and Web Design   :::   510.923.0000