PHP Redirects Other than header(location:)

  • Context: PHP 
  • Thread starter Thread starter JamesU
  • Start date Start date
  • Tags Tags
    Php
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
6 replies · 4K views
JamesU
Gold Member
Messages
828
Reaction score
3
Is there another way to redirect in PHP other than the header(location:) method...? such as one that can be used in a function.
 
Physics news on Phys.org
Download the PHP manual, it has all you need to know.
 
You can use Javascript to redirect using:
Code:
<script>
window.location = '[PLAIN]https://www.physicsforums.com';[/PLAIN] 
</script>
So one alternative is to redirect using PHP to write that on top of a page.
 
Last edited by a moderator:
Big help verty... :rolleyes:


The two listed are the two I use, but I'm not a whiz.
 
Dave, teach a man to fish...
 
verty said:
Dave, teach a man to fish...

This is a help forum. He's come here for help because he didn't find the answer.

With your philosophy, this entire Physics board would be one page: a keyword search of Amazon.com. :-p
 
I'm not that harsh. I knew others would answer. I think in some browsers a window might pop up saying "the page is trying to redirect" if your redirect is to a different server.