This snippet will download a url, be it a basic html page or result of a php query, or whatever.
It basically downloads webpage output to a temp file, then reads it in line-by-line and sticks it in a variable for you to parse or do what you like with it.
So you can effectively run a php script on a webpage by using this method and collect any output at the same time.
w$="http://www.purple.com/purple.html"
a$=download(w$)
if a$=""
print "Error Downloading"
else
print "Downloaded OK"
print "Contents:"
print a$
endif
wait key
function download(w$)
f$="tempfile.txt"
if file exist(f$) then delete file f$
c$=""
load dll "urlmon",1
a=CALL DLL(1,"URLDownloadToFileA",0,w$,f$,0,0)
delete dll 1
if a=0
open to read 1,f$
while file end(1)=0
read string 1,v$
if c$ <> "" then c$=c$+chr$(13)+chr$(10)
c$=c$+v$
endwhile
close file 1
endif
if file exist(f$) then delete file f$
endfunction c$
Boo!