Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

covert php file_get_contents to VB Script help

Status
Not open for further replies.

Dio1080

IS-IT--Management
Jun 27, 2009
3
US
I tried to google this but no luck. I was wondering if anybody know how to convert this php command into visual basic script?

PHP:
<?
$page=file_get_contents('[URL unfurl="true"]http://www.example.com/page?user=cwarn23&pass=820578wxz56240358');[/URL]
?>
 
[tt]dim surl
'the given
[green]surl="[ignore][/ignore]"[/green]

dim oxmlhttp,page
on error resume next
set oxmlhttp=createobject("msxml2.xmlhttp")
with oxmlhttp
.open "get",surl,false
.send
page=.responsetext
end with
if err.number<>0 then
'Resource unavailable for varied reasons. Empty string assigned
page=""
end if
set oxmlhttp=nothing
on error resume next
[green]'page stored the desired result (equivalent to $page)[/green]
[/tt]
 
dim surl
'the given
surl="
dim oxmlhttp,page
on error resume next
set oxmlhttp=createobject("msxml2.xmlhttp")
with oxmlhttp
.open "get",surl,false
.send
page=.responsetext
end with
if err.number<>0 then
'Resource unavailable for varied reasons. Empty string assigned
page=""
end if
set oxmlhttp=nothing
on error resume next
'page stored the desired result (equivalent to $page)


Can you explain the code to me, I'm new to visual basic script?
 
No, I would not for a request that general. It is not for those completely new to vbs. There are better ways to learn vbs than learn it that way. Maybe some other members would volunteer.
 
note to self:
The second "on error resume next" should be read "on error goto 0". Apart from that, nothing to add.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top