Redirecting a request to another URLΒΆ
web_redirect() |
Redirect a request to another URL |
SYNTAX
web_redirect(url_string)
Redirect the request to another URL, which can be on the same web server or on a different one. The program must not put cookies or output headers before calling this function, nor may it execute a print or put statement. The user can however define cookies or headers after the call to web_redirect, which can be useful.
Normally the program will exit after calling this function, but it may output HMTL code if required.
The function returns 0 (OK) or a negative value to indicate an error. The possible errors are:
WWW_ERR_NOT_IN HEADER
WWW_ERR_NOT_IN_FIRST HEADER
EXAMPLES
web_redirect("/cgi-bin/nph-srep.exe"+ "?login.sch")
web_redirect(encode_session_url("/cgi-bin/nph-srep?index.sch"))
RELATED TOPICS |