From Lingo to Transcript

Mark Smith mark at maseurope.net
Mon Dec 18 06:27:49 EST 2006


Stu, perhaps you need to format the data you're sending as an http  
form (name/value pairs)?

so

put urlEncode("vto=" & "jdoe at 123.com") & "&" into tFormData
put urlencode("vfrom=" & "jsmith at xyz.com") & "& after tFormData
etc.......

which you could split out to a function:

function makeFormData pInputArray
   repeat for each line K in the keys of pInputArray
      put urlEncode(K) & "=" & urlEncode(pInputArray[K]) & "&" after  
tFormData
    end repeat
    delete char -1 of tFormData -- get rid of trailing "&"
    return tFormData
end makeFormData

so in your script:

put "jdoe at 123.com" into tFormArray["vto"]
put  "jsmith at xyz.com" into tFormArray["vfrom"]
put "Quiz Results" into tFormArray["vsubject"]
put "Your Quiz Results" into tFormArray["vbody"]
post (makeFormData(tFormArray)) to URL "http://www.mysite.com/cgi-bin/ 
mailer.cgi"
put it


Best,

Mark


On 18 Dec 2006, at 03:31, <revolution at duncansoftware.com>  
<revolution at duncansoftware.com> wrote:

> I have an existing program created in Director that I am porting to  
> Revolution.
>
> At a certain point in the program, data is posted to a CGI script  
> which sends out 2 emails. One of the emails gets its addresses
> from the CGI script itself. They are hard coded into the script.  
> The other email gets its addresses and data from the info that is
> posted. It works fine in the Director version, but I am having  
> trouble getting the port to work.
>
> Here is the functioning Lingo version:
>
> vto = "jdoe at 123.com"
> vfrom = "jsmith at xyz.com"
> vsubject "Quiz Results"
> vbody = "Your Quiz Results"
> propList = [#vto: vto, #vfrom: vfrom, #vsubject: vsubject, #vbody:  
> vbody]
> thisNetId = postNetText (thisURL, propList)
>
> Here is my nonfunctional Transcript version:
>
> put "jdoe at 123.com" into vto
> put  "jsmith at xyz.com" into vfrom
> put "Quiz Results" into vsubject
> put "Your Quiz Results" into vbody
> post (vto && vfrom && vsubject && vbody) to URL "http:// 
> www.mysite.com/cgi-bin/mailer.cgi"
> put it
>
> The "it" variable comes back with "No recipient addresses found in  
> header".
>
> The error, I expect, is in the format that I am sending the string  
> in the post command. The command is reaching the cgi script
> because the hard coded email is being sent but the second with the  
> posted data is not.
>
> Sorry for all of the pseudo data in the scripts, I have signed a  
> bucket of NDAs.
>
> Stu
>
>
>
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list