| View previous topic :: View next topic |
| Author |
Message |
Hippo Contributor


Joined: 08 Feb 2005 Posts: 53
|
Posted: Tue Sep 26, 2006 8:50 am Post subject: Vdsipp and Returncode |
|
|
Im creating some software to monitor a users website and notify them if it goes down.
I using the returncode function of vdsipp and there is a problem.
It returns correctly a code 200 if the site exists
But it returns 0 is the site doesnt exist, when it should return a 404
TIA
| Code: | Internet HTTP,get,1,http://www.google.com
%%statuscode = @INTERNET(HTTP,RETURNCODE,1) |
EDIT: Just checked the HTTP example in vdsipp and this does the same
Are there any other Dll's that can do a similar function? |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1566
|
Posted: Wed Sep 27, 2006 12:55 am Post subject: |
|
|
Errorcode 404 is returned when a server cannot find the page you are requesting only - missing page.
If vdsipp has no access to internet, loss in internet or the site does not exist you will not get an error code 404, or any error code in fact. I'm not sure where you got the impression you are supposed to get error code 404 when a server/site does not exist.
Errorcodes are returned by the web server software, if a site does not exist or you have no internet connection there is absolutely no server to return an error code, thus a 0 error code is returned by vdsipp.
Your method should also not rely on errorcodes alone, you should check the header using the head command to get back valid information. |
|
| Back to top |
|
 |
Hippo Contributor


Joined: 08 Feb 2005 Posts: 53
|
Posted: Thu Sep 28, 2006 1:49 pm Post subject: |
|
|
I've looked into this a little further and thinking about it, if you can't communicate with the server how are you going to get a status code?
D'oh
My program now interprets a status code of '0' as site offline or unreachable.
Thanks for the help. |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1566
|
Posted: Thu Sep 28, 2006 2:48 pm Post subject: |
|
|
| Right, the code 0 should mean the computer does not have a valid connection to the internet or the website does not exist at all. In the case of when you get a 0, you can try to use a WHOIS on the domain to see if the domain even exists, if you get back no valid information (blank) then there is no internet connection, if you get back some information but the domain does not exist then you know there is no website/domain. |
|
| Back to top |
|
 |
|