Strings as URL Parameters

Jan Schenkel janschenkel at yahoo.com
Tue Nov 25 04:07:36 EST 2003


--- Dan Shafer <revdan at danshafer.com> wrote:
> What is the best way to attach a string as a
> parameter to a URL so that  
> it gets sent in its entirety and isn't surrounded by
> quotation marks on  
> the receiving end?
> 
> I have a URL that looks sort of like:
> 
>
http://www.sitename.com/cgi-name?command@user:pwd@location!
> 
> filename=test2.txt&text="This is some text"
> 
> Typed into a browser, it works perfectly.
> 
> Run from Revolution, only the first word of the text
> string appears as  
> a value in file being created on the server.
> (Actually, the behavior of  
> this whole thing out of Rev seems erratic to me but
> I haven't been able  
> to nail down a pattern. If I could figure out how to
> do this one thing  
> reliably, I could probably easily determine if
> there's a deeper  
> underlying issue here.)
> 
> I searched the archives but couldn't find any help.
> 
> I'll appreciate any pointers or thoughts or even
> random ideas! So far,  
> this feels like a Rev bug.
> 
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Dan Shafer

Hi Dan,

Have a look at the Transcript Dictionary entry for the
URLEncode function ; this should automatically turn a
string into a valid URL. Example :
  put URLEncode("Test string $$")
  --> returns "Test+string+%24%24"

In you case, you should adapt your screipt a bit to
produce a URL of the form :
 
<http://www.sitename.com/cgi-name?command@user:pwd@location!filename=test2.txt&text=This+is+some+text>

Hope this helped,

Jan Schenkel. 

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree


More information about the use-livecode mailing list