Get Data from a web address

Hey there. I have a PHP file, connected to a MySQL database, at localhost. When the URL localhost/?link=me is accessed, it passes a SQL query and, in turn, receives the value 1 and echoes it on the page.
My question is the following:
How do I take that information, now sitting on localhost/?link=me, and have Xojo write it down in a text label?
Thanks for any help
Tim

Timothy,

You can use the URLConnection class using the content received event. Then parse and use the received response and then populate your label.

https://docs.xojo.com/URLConnection

You also have several example projects for URLConnection within the Xojo IDE

Examples/Communication/Internet/URLConnection/FileDownloader

Examples/Communication/Internet/URLConnection/URLConnectionGET

Hth

Thanks for the help, Mike!
This method worked, and the demo project was a great help.

1 Like

That is great news! Could you please mark this as the correct answer so that this will be clear for future searches by other Xojo users?

Thanks!
Mike

1 Like
Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.