PHP Redirects Other than header(location:)

  • Context: PHP 
  • Thread starter Thread starter JamesU
  • Start date Start date
  • Tags Tags
    Php
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
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
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.
 
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.