niceone Posted July 9, 2008 Posted July 9, 2008 Just curious how would I go about reading text from an ini then placing it into a url? example being this is my ini [Main] ErrorVersion=One3 ErrorMode=Two11 I want to be able to read the ErrorVersion & ErrorMode contents and send them away in a url (example http://members.lycos.co.uk/username/func.php?&ErrorVersion=%s&ErrorMode=%s where ErrorVersion=%s place One3 Where ErrorMode=%s place Two11 I already know how to submit urls I already have my php site and stuff setup would just like to know how to read the contents of my config and place it in a url sorry if I've confused anyone ><.. just having trouble with this muttley
Airwolf Posted July 9, 2008 Posted July 9, 2008 It sounds like you just need to take a look at IniRead() in the AutoIt Help File. Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->[u]AutoIt v3 Development - newbie to g33k[/u] - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt
niceone Posted July 9, 2008 Author Posted July 9, 2008 That was the first thing I did :/ I just couldn't make any sense of it.
Airwolf Posted July 9, 2008 Posted July 9, 2008 That was the first thing I did :/ I just couldn't make any sense of it.To read the following INI (if it were named example.ini): [Main] ErrorVersion=One3 ErrorMode=Two11 You would do the following: $errorversion = IniRead("example.ini","Main","ErrorVersion") $errormode = IniRead("example.ini","Main","ErrorMode") $errorversion's value would be One3, and $errormode's value would be Two11. Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->[u]AutoIt v3 Development - newbie to g33k[/u] - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt
niceone Posted July 9, 2008 Author Posted July 9, 2008 I'm receiving this error,also its sending my url but only with %s & %s instead somthing likehttp://members.lycos.co.uk/username/func.php?&ErrorVersion=One3&ErrorMode=Two11I have my ini named example.ini as well
Moderators SmOke_N Posted July 9, 2008 Moderators Posted July 9, 2008 I'm receiving this error, also its sending my url but only with %s & %s instead somthing like http://members.lycos.co.uk/username/func.php?&ErrorVersion=One3&ErrorMode=Two11 I have my ini named example.ini as wellThere are 4 parameters to IniRead (ini, section, key, text you want to use as a value if it isn't found), you're missing the last one. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Airwolf Posted July 9, 2008 Posted July 9, 2008 There are 4 parameters to IniRead (ini, section, key, text you want to use as a value if it isn't found), you're missing the last one.Whoops, sorry. My fault. I forgot about that part in the example I gave niceone. Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->[u]AutoIt v3 Development - newbie to g33k[/u] - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt
niceone Posted July 9, 2008 Author Posted July 9, 2008 That fixed the error perfectly sadly its still not submitting the contents of the ini in my url when the url is submitted muttley
metalicaman8 Posted July 9, 2008 Posted July 9, 2008 post full code with sensitive info omitted [center]Take the Magic: The Gathering 'What Color Are You?' Quiz.[/center]
Moderators SmOke_N Posted July 9, 2008 Moderators Posted July 9, 2008 That fixed the error perfectly sadly its still not submitting the contents of the ini in my url when the url is submitted muttleyLooks like you need to understand how to concatenate strings with variables.$errorversion = IniRead("example.ini","Main","ErrorVersion", "") $errormode = IniRead("example.ini","Main","ErrorMode", "") $http = "http://members.lycos.co.uk/username/func.php?" & $errorversion & "=%s" & $errormode & "=%s" MsgBox(64, "Info", $http) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
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