Viggen
(Starting to like KiXtart)
2006-08-30 08:26 AM
Can't get ReadHTML() , GetPage() or GetURL() to work...

Hi All!

I have tried to use the different functions and I get the same strange result...

If I take this url: "http://www.geocaching.com/seek/cache_details.aspx?wp=GCHVGX"
and paste it into IE it will display a page, but if I use any of the functions, I get nothing?

If I shorten the url to: "http://www.geocaching.com/seek/cache_details.aspx?wp=GCHVG"
IE will display an error-page, and the fuctions work as they suppose to do??

this is my simple testscript


Code:
 $html = GetPage('http://www.geocaching.com/seek/cache_details.aspx?wp=GCHVGX')
? $html

FUNCTION GetPage($URL)
DIM $HTML, $IECacheKey, $IECacheVal
$IECacheKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
$IECacheVal = READVALUE($IECacheKey, "SyncMode5")
IF $IECacheVal <> 3
$nul = WRITEVALUE($IECacheKey, "SyncMode5", "3", "REG_DWORD")
ENDIF
$HTML = CREATEOBJECT("microsoft.XMLhttp")
$HTML.Open("GET", $URL, NOT 1)
$HTML.Send
IF $HTML.Status = 200
$GetPage = $HTML.ResponseText ;or ResponseBody
ELSE
$GetPage = "HTTP Status Code: " + $HTML.Status + " (" + $HTML.StatusText + ")"
EXIT 1
ENDIF
$nul = WRITEVALUE($IECacheKey, "SyncMode5", $IECacheVal, "REG_DWORD")
ENDFUNCTION



I only changed the functions between the tests.

I guess there's an obvious reason to why this isn't working, but I can't wrap my head around it

/Viggen


NTDOCAdministrator
(KiX Master)
2006-08-30 11:12 AM
Re: Can't get ReadHTML() , GetPage() or GetURL() to work...

Not sure why but it doesn't work for me either. Neither does GetURL

However, FTPget() does work for me.


Viggen
(Starting to like KiXtart)
2006-08-30 12:41 PM
Re: Can't get ReadHTML() , GetPage() or GetURL() to work...

Thanx!

The thought of downloading the file first, never crossed my mind...

Works fine now.


LonkeroAdministrator
(KiX Master Guru)
2006-08-31 12:41 AM
Re: Can't get ReadHTML() , GetPage() or GetURL() to work...

btw, nice to see you still remembered your old account info...

Viggen
(Starting to like KiXtart)
2006-08-31 01:57 AM
Re: Can't get ReadHTML() , GetPage() or GetURL() to work...

Yea...
been away from kixin' way too long
(had som family issues that needed alot of my attention)

It was nice to see that my account still existed