Response.Redirect in a loop?!

M

Malcolm Messiter

Hello

I have a question to while I hope someone has the answer!

In order to send several SMS texts from a web site, I need to invoke a new
URL with a query string containing the parametres. So I put:

<%
while (something)
Response.Redirect www.xyz.com?p1=xx,p2=yy... etc.
wend
%>

Trouble is of course, control goes off to the xyz site never to return.

What's the solution?!

Best wishes

Malcolm Messiter
 
S

Steven Burn

While <something>
'// Setup Init
Dim objXMLHTTP, tmStart, bErrorReturned, tmCurr, iTimeTaken, strURL
strURL = "http://www.xyz.com?p1=xx,p2=yy"

'// Begin objXMLHTTP
set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")
on error resume next
objXMLHTTP.open "POST", strURL, false
objXMLHTTP.setRequestHeader "User-Agent",
Request.ServerVariables("HTTP_HOST")
objXMLHTTP.send ""
tmStart = Now
bErrorReturned = 0
Do
tmCurr = Now
iTimeTaken = CInt(DateDiff("s", tmStart, tmCurr))
If iTimeTaken > 8 Then '// 8 = timeout (in seconds)
Response.Write = "<font color=""#ff0000""><b>Error: Query timed
out</b></font>"
objXMLHTTP.Abort
bErrorReturned = 1
Exit Do
End If
Loop While objXMLHTTP.ReadyState <> 4
If bErrorReturned <> 1 Then
if Err.Number <> 0 or objXMLHTTP.Status <> 200 then
Response.Write = "<font color=""#ff0000""><b>Error: Query timed
out</b></font>"
else
Response.Write = objXMLHTTP.ResponseText
end if
end if
set objXMLHTTP = nothing
Loop

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
 
S

Steven Burn

hehe knew I'd forget to remove something (I originally wrote it as a
function, hence the =)

Apologies for the screwup :eek:\

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
 
M

Malcolm Messiter

I tried this thanks! I get a timeout error every time, but the URL does
work when tested on its own.
Any ideas?!

Thanks!!

Malcolm
 
M

Malcolm Messiter

Thanks again! It's working now. I had blocked ALL udp ports on the server.
With them open it can get to a DNS server and resolve the address.

They're ALL open now. I wish I knew which ports were needed. I'd prefer to
close the rest.

Do you know which ports are needed for DNS?

Best wishes

Malcolm
 
S

Steven Burn

53

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

::: Declaration :::

Ur I.T. Mate Group is NOT a company, it is a non-commercial and not for
profit collection of websites developed and maintained by Steven Burn.

Websites and domains currently owned by Ur I.T. Mate Group are provided on a
free to view and use basis. Ur I.T. Mate Group does not and will not ask for
or solicit, personal information*, password, credit card details or
payments. For more information, please see our Privacy Policy.

Ur I.T. Mate Group and Steven Burn (CEO) are based in the United Kingdom.

* Except where registration for an online service is required (e.g. forums,
sGB)
 
M

Malcolm Messiter

Thanks ... but I tried that, and with only 53 open (UDP, and TCP too for
good measure) it fails. I guess it needs other UDP port(s) too. I wonder
which ?!
 
S

Steven Burn

I've only opened port 53 for it on my router (TCP/UDP incoming/outgoing) and
it's running fine?

Have you checked the DNS data in the Event Viewer?

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk
 
M

Malcolm Messiter

I haven't checked the Event Viewer - not sure I know how! I will look into
that.
It certainly stopped working when I only had 53 open, and I guess I need
to see what other ports are in use. I'll try now to run this event
viewer....
 
M

Malcolm Messiter

I've played with the Event Viewer now for a while. Cannot seem to see any
DNS or UDP data....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top