WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.


How to

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Webpage Redirect


Is there a comparable function for WebBatch like Redirect in ASP?


I guess you could write a UDF to handle this. There are a few possible options:

Using a Meta tag

#DefineFunction WebRedirect(URL)

   WebOut(StrCat('Content-type: text/html',@CRLF,@CRLF,'<HTML><HEAD><META http-equiv="refresh" content="0; URL=', URL, '"></HEAD><BODY><A HREF="', URL ,'">', URL, '</a></body></html>'), 1)



Status 302 Redirect

#DefineFunction Redirect(url)

   WebOut("Status: 302 Found",1)
   WebOut(StrCat("Location: ",url),2)   ; NOTE 2 CRLF's after url !



Status 302 Redirect with html

#DefineFunction RedirectWithHTML(url,html)

  WebOut("Status: 302 Found",1)
  WebOut(StrCat("Location: ",url),1)    ; NOTE 1 CRLF after url !
  WebOut("Content-type: text/html",2)   ; NOTE 2 CRLF's after url !
  WebOut(html,1)                        ; assumes html is some properly formatted html for a display page


html = '<HTML><HEAD></HEAD><BODY>Redirecting you to <A HREF=""></a></body></html>'
RedirectWithHTML("", html)

To see a list of other 'Status code definitions' check out:

Article ID:   W16301
File Created: 2017:07:28:13:58:12
Last Updated: 2005:02:18:12:19:42