oldgeezer Posted January 20, 2006 Share Posted January 20, 2006 Any ideas how to build a string that is suitable to be passed to a php script on a server? What I am trying to do is build a string that is: http://www.somesite.com/ascript.php?url=-http://www.anotherurl.com/file.pl?option1=string1 etcIn Autoit3 how do i put this into the proper escaped format so that the php script on the server can unescape it and use it as input parameter? (I know how to take URLs in php and unescape them)Any ideas? Link to comment Share on other sites More sharing options...
w0uter Posted January 20, 2006 Share Posted January 20, 2006 $url = "http://www.anotherurl.com/file.pl?option1=" & $string1 is that what you mean ? My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
oldgeezer Posted January 20, 2006 Author Share Posted January 20, 2006 (edited) $url = "http://www.anotherurl.com/file.pl?option1=" & $string1is that what you mean ?No. I mean is the a function to convert a normal string to an escaped format for use within a web browser:For example:-somescript?name="Espen Lyngaas"&age=I'm 32 years oldTo be converted to:-somescript?name=%22Espen+Lyngaas%22&age=I%27m+32+years+oldThis can then be fed to a browser to run a program on a web server with two input parameter of name and age, you see? Edited January 20, 2006 by oldgeezer Link to comment Share on other sites More sharing options...
CyberSlug Posted January 20, 2006 Share Posted January 20, 2006 Possible approach: $t = '-somescript?name="Espen Lyngaas"&age=I''m 32 years old' ;Note: had to add an extra apostrophe for AutoIt to accept the string.... $t = StringReplace($t, '"', "%22") $t = StringReplace($t, '"', "%27") $t = StringReplace($t, "(", "%28") $t = StringReplace($t, ")", "%29") $t = StringReplace($t, "@", "%40") $t = StringReplace($t, " ", "+") ;$t = StringReplace($t, " ", "%20") ;$t = StringReplace($t, "?", "%3F") ;$t = StringReplace($t, "=", "%3D") ;$t = StringReplace($t, "&", "%26") MsgBox(4096,"Output", $t) Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
oldgeezer Posted January 20, 2006 Author Share Posted January 20, 2006 (edited) Possible approach: $t = '-somescript?name="Espen Lyngaas"&age=I''m 32 years old' ;Note: had to add an extra apostrophe for AutoIt to accept the string.... $t = StringReplace($t, '"', "%22") $t = StringReplace($t, '"', "%27") $t = StringReplace($t, "(", "%28") $t = StringReplace($t, ")", "%29") $t = StringReplace($t, "@", "%40") $t = StringReplace($t, " ", "+") ;$t = StringReplace($t, " ", "%20") ;$t = StringReplace($t, "?", "%3F") ;$t = StringReplace($t, "=", "%3D") ;$t = StringReplace($t, "&", "%26") MsgBox(4096,"Output", $t) Thanks Cyberslug. Yes I see.. Is there a complete list on the web of these special characters and corresponding values they have to be converted to? Thanks. edit: Is this http://webdesign.about.com/od/characterset...l_htmlcodes.htm basically the sort of table i need to use, i guess. Edited January 20, 2006 by oldgeezer Link to comment Share on other sites More sharing options...
w0uter Posted January 20, 2006 Share Posted January 20, 2006 its in your helpfile or you could just use '%' & asc() My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
oldgeezer Posted January 21, 2006 Author Share Posted January 21, 2006 its in your helpfile or you could just use '%' & asc()LOL.. So it is.. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now