forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Vdsipp and Returncode

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Hippo
Contributor
Contributor


Joined: 08 Feb 2005
Posts: 53

PostPosted: Tue Sep 26, 2006 8:50 am    Post subject: Vdsipp and Returncode Reply with quote

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 Sad

Are there any other Dll's that can do a similar function?
Back to top
View user's profile Send private message
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1566

PostPosted: Wed Sep 27, 2006 12:55 am    Post subject: Reply with quote

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
View user's profile Send private message
Hippo
Contributor
Contributor


Joined: 08 Feb 2005
Posts: 53

PostPosted: Thu Sep 28, 2006 1:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1566

PostPosted: Thu Sep 28, 2006 2:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group