Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > what am I doing wrong.....

Reply
Thread Tools

what am I doing wrong.....

 
 
Graham Mattingley
Guest
Posts: n/a
 
      09-10-2003
Hello

I have this coden (below), that I found that works really well when to prove
a URL is valid, or any object in a URL. They way it works is that you submit
the URL through a form, txtURL is the varable...

What I want to be able to do is have a database of URLs and loop through
them with this in the middle and check all the URLs I have on my database..

so I did

txtURL=rsIslandinfo("URL").Value --- (my database varable)

the whole page loads in about 2 seconds, and all the URL have tested as
invalid, I suspect the value txtURL is not being applyed to the XMLHTTP
object..

any ideas, I wanted to test my database of links are up to date

Regards

Graham Mattingley



if len(trim(Request("txtURL"))) > 0 then
iStatus = 0
sURL = trim(Request("txtURL"))
'Set obj = CreateObject("Microsoft.XMLHTTP")
Set obj = CreateObject("MSXML2.XMLHTTP.4.0")
on error resume next
obj.open "GET", sURL, False
obj.send
if err.number = 0 then
iStatus = obj.Status
end if
on error goto 0

if iStatus = 200 then
Response.write "<p>The URL is valid, status is " & iStatus & "</p>" & vbCRLF
else
Response.write "<p>The URL is invalid, status is " & iStatus & "</p>" &
vbCRLF
end if
end if



 
Reply With Quote
 
 
 
 
Tom B
Guest
Posts: n/a
 
      09-10-2003
What value do you get for iStatus?
"Graham Mattingley" <(E-Mail Removed)> wrote in message
news:bjo6nq$2cq$1$(E-Mail Removed)...
> Hello
>
> I have this coden (below), that I found that works really well when to

prove
> a URL is valid, or any object in a URL. They way it works is that you

submit
> the URL through a form, txtURL is the varable...
>
> What I want to be able to do is have a database of URLs and loop through
> them with this in the middle and check all the URLs I have on my

database..
>
> so I did
>
> txtURL=rsIslandinfo("URL").Value --- (my database varable)
>
> the whole page loads in about 2 seconds, and all the URL have tested as
> invalid, I suspect the value txtURL is not being applyed to the XMLHTTP
> object..
>
> any ideas, I wanted to test my database of links are up to date
>
> Regards
>
> Graham Mattingley
>
>
>
> if len(trim(Request("txtURL"))) > 0 then
> iStatus = 0
> sURL = trim(Request("txtURL"))
> 'Set obj = CreateObject("Microsoft.XMLHTTP")
> Set obj = CreateObject("MSXML2.XMLHTTP.4.0")
> on error resume next
> obj.open "GET", sURL, False
> obj.send
> if err.number = 0 then
> iStatus = obj.Status
> end if
> on error goto 0
>
> if iStatus = 200 then
> Response.write "<p>The URL is valid, status is " & iStatus & "</p>" &

vbCRLF
> else
> Response.write "<p>The URL is invalid, status is " & iStatus & "</p>" &
> vbCRLF
> end if
> end if
>
>
>



 
Reply With Quote
 
 
 
 
Curt_C [MVP]
Guest
Posts: n/a
 
      09-10-2003
this is what I use to validate a URL
http://www.darkfalz.com/1046


--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------


"Graham Mattingley" <(E-Mail Removed)> wrote in message
news:bjo6nq$2cq$1$(E-Mail Removed)...
> Hello
>
> I have this coden (below), that I found that works really well when to

prove
> a URL is valid, or any object in a URL. They way it works is that you

submit
> the URL through a form, txtURL is the varable...
>
> What I want to be able to do is have a database of URLs and loop through
> them with this in the middle and check all the URLs I have on my

database..
>
> so I did
>
> txtURL=rsIslandinfo("URL").Value --- (my database varable)
>
> the whole page loads in about 2 seconds, and all the URL have tested as
> invalid, I suspect the value txtURL is not being applyed to the XMLHTTP
> object..
>
> any ideas, I wanted to test my database of links are up to date
>
> Regards
>
> Graham Mattingley
>
>
>
> if len(trim(Request("txtURL"))) > 0 then
> iStatus = 0
> sURL = trim(Request("txtURL"))
> 'Set obj = CreateObject("Microsoft.XMLHTTP")
> Set obj = CreateObject("MSXML2.XMLHTTP.4.0")
> on error resume next
> obj.open "GET", sURL, False
> obj.send
> if err.number = 0 then
> iStatus = obj.Status
> end if
> on error goto 0
>
> if iStatus = 200 then
> Response.write "<p>The URL is valid, status is " & iStatus & "</p>" &

vbCRLF
> else
> Response.write "<p>The URL is invalid, status is " & iStatus & "</p>" &
> vbCRLF
> end if
> end if
>
>
>



 
Reply With Quote
 
Graham Mattingley
Guest
Posts: n/a
 
      09-11-2003
I get Value 0


"Tom B" <(E-Mail Removed)> wrote in message
news:uyShhF$(E-Mail Removed)...
> What value do you get for iStatus?
> "Graham Mattingley" <(E-Mail Removed)> wrote in message
> news:bjo6nq$2cq$1$(E-Mail Removed)...
> > Hello
> >
> > I have this coden (below), that I found that works really well when to

> prove
> > a URL is valid, or any object in a URL. They way it works is that you

> submit
> > the URL through a form, txtURL is the varable...
> >
> > What I want to be able to do is have a database of URLs and loop through
> > them with this in the middle and check all the URLs I have on my

> database..
> >
> > so I did
> >
> > txtURL=rsIslandinfo("URL").Value --- (my database varable)
> >
> > the whole page loads in about 2 seconds, and all the URL have tested as
> > invalid, I suspect the value txtURL is not being applyed to the XMLHTTP
> > object..
> >
> > any ideas, I wanted to test my database of links are up to date
> >
> > Regards
> >
> > Graham Mattingley
> >
> >
> >
> > if len(trim(Request("txtURL"))) > 0 then
> > iStatus = 0
> > sURL = trim(Request("txtURL"))
> > 'Set obj = CreateObject("Microsoft.XMLHTTP")
> > Set obj = CreateObject("MSXML2.XMLHTTP.4.0")
> > on error resume next
> > obj.open "GET", sURL, False
> > obj.send
> > if err.number = 0 then
> > iStatus = obj.Status
> > end if
> > on error goto 0
> >
> > if iStatus = 200 then
> > Response.write "<p>The URL is valid, status is " & iStatus & "</p>" &

> vbCRLF
> > else
> > Response.write "<p>The URL is invalid, status is " & iStatus & "</p>" &
> > vbCRLF
> > end if
> > end if
> >
> >
> >

>
>



 
Reply With Quote
 
Tom B
Guest
Posts: n/a
 
      09-11-2003
Try taking out your on error resume next.
You have an if statement that's keeping iStatus from getting a value.

"Graham Mattingley" <(E-Mail Removed)> wrote in message
news:bjovl0$h33$1$(E-Mail Removed)...
> I get Value 0
>
>
> "Tom B" <(E-Mail Removed)> wrote in message
> news:uyShhF$(E-Mail Removed)...
> > What value do you get for iStatus?
> > "Graham Mattingley" <(E-Mail Removed)> wrote in message
> > news:bjo6nq$2cq$1$(E-Mail Removed)...
> > > Hello
> > >
> > > I have this coden (below), that I found that works really well when to

> > prove
> > > a URL is valid, or any object in a URL. They way it works is that you

> > submit
> > > the URL through a form, txtURL is the varable...
> > >
> > > What I want to be able to do is have a database of URLs and loop

through
> > > them with this in the middle and check all the URLs I have on my

> > database..
> > >
> > > so I did
> > >
> > > txtURL=rsIslandinfo("URL").Value --- (my database varable)
> > >
> > > the whole page loads in about 2 seconds, and all the URL have tested

as
> > > invalid, I suspect the value txtURL is not being applyed to the

XMLHTTP
> > > object..
> > >
> > > any ideas, I wanted to test my database of links are up to date
> > >
> > > Regards
> > >
> > > Graham Mattingley
> > >
> > >
> > >
> > > if len(trim(Request("txtURL"))) > 0 then
> > > iStatus = 0
> > > sURL = trim(Request("txtURL"))
> > > 'Set obj = CreateObject("Microsoft.XMLHTTP")
> > > Set obj = CreateObject("MSXML2.XMLHTTP.4.0")
> > > on error resume next
> > > obj.open "GET", sURL, False
> > > obj.send
> > > if err.number = 0 then
> > > iStatus = obj.Status
> > > end if
> > > on error goto 0
> > >
> > > if iStatus = 200 then
> > > Response.write "<p>The URL is valid, status is " & iStatus & "</p>" &

> > vbCRLF
> > > else
> > > Response.write "<p>The URL is invalid, status is " & iStatus & "</p>"

&
> > > vbCRLF
> > > end if
> > > end if
> > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
recommendation doing co-simulation between c/c++ with vhdl Carson VHDL 0 10-05-2005 07:40 PM
What is VS Doing to my Code??? downs.matt@gmail.com ASP .Net 1 09-02-2005 11:38 AM
Why is Mozilla doing this ... and how to fix it Joe S. Firefox 7 06-07-2005 04:12 AM
VB6/VB.Net Programming Question - what am i doing wrong? Salisha Khan ASP .Net 1 08-01-2003 01:55 PM
What am I doing wrong? Keith R. Williams VHDL 4 07-15-2003 03:08 AM



Advertisments