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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I capture a ASP to a variable

Status
Not open for further replies.
Here is a bit of script that I pulled from a newsgroup.
You should be able to take and adapt it to your needs.

hth

<%@ Language=VBScript %>
<%
Response.Buffer = True
Dim objXMLHTTP, xml

' Create an xmlhttp object:
'Set xml = Server.CreateObject(&quot;Microsoft.XMLHTTP&quot;)
Set xml = Server.CreateObject(&quot;MSXML2.ServerXMLHTTP&quot;)

' Opens the connection to the remote server.
xml.Open &quot;GET&quot;, &quot; False


' Actually Sends the request and returns the data:
xml.Send

'Display the HTML both as HTML and as text
Response.Write &quot;<h1>The HTML text</h1><xmp>;&quot;
Response.Write xml.responseText
Response.Write &quot;</xmp><p><hr><p><h1>The HTML Output</h1>&quot;

Response.Write xml.responseText


Set xml = Nothing
%>
 
Thanks cbokowski
Your script works great. It did the job. Thanks.
By the way, I would like in a certain period of time (ex. 10 min, 20 min ) it will check to see if that ID is online or not, Everytime it checks, it will compare if it is different with the last time, if it is same with the last time it check , do nothing, if not, send me an email .
In VB or VFP I can use the timer object to do it. but I don't know in ASP.
Thanks for your help.
 
Here is something. You would have to have a window open all the time.

<BODY onLoad='setTimeout('reloadmypage();',15000)>
'the settimeout will repost after the time you specify.


<script language=javascript
function reloadmypage()
{
location='mypage.asp';
}
</SCRIPT>

with in your code then you could do whatever you needed.

hth
 
Thanks for the response, but with that way, I can never check to see if the last check will be the same with the current check .
In the other word, how can we store the value of last check to compare with current check?
Thanks
 
write the previous check to a db with date/time stamp. then each check compare to the last.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top