Jump to content

ini & submit url question


Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

I'm receiving this error,

Posted Image

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 well

Link to comment
Share on other sites

  • Moderators

I'm receiving this error,

Posted Image

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 well

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.

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Moderators

That fixed the error perfectly sadly its still not submitting the contents of the ini in my url when the url is submitted

muttley

Looks 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.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...