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

redirect to page x if not on page x

Status
Not open for further replies.

SlykFX

Programmer
Oct 12, 2002
76
GB
my site has quite a large include file that contains all the page styles, db connection, etc.

however, it contains a line that if a certain instance in the db is true it redircts to another page
this page also requires the use of the include file (i dont want to copy the current file minus the redirection line as im constantly updating the includes and dont want the headache of doing it twice!)

what i need to know is how do i stop the redirection process if the include file was called from the locDel.asp page?

my current code stands as
Code:
if status = True then
  if request.servervariables(&quot;URL&quot;) <> &quot;locDel.asp&quot; then
    response.redirect &quot;locDel.asp&quot;
  end if
end if
status has been set from the database several lines up (it is either true or false depending)

if it is called on the locDel.asp page then it just goes into the endless loop of openning locDel.asp

any suggestions? or am i gonna be giving myself a headache?

I can't be bothered to have a sig!
 
on my machine, i get URL as the file name prefixed with &quot;/&quot; if the file is in the root.

for example,

would result in

request.servervariables(&quot;url&quot;) = &quot;/foo/bar.asp&quot;



=========================================================
try { succeed(); } catch(E) { tryAgain(); }
-jeff
 
thanks

i actually solved this about half an hour ago, ive just come back to say its sorted

taking a break helps loads
i went had a drink came back and decided to look what the actual output of request.servervariables(&quot;url&quot;) was and realised the obvious

all fixed now, thanks anyway

I can't be bothered to have a sig!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top