Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Automatic Redirect without headers


ghost's Avatar
0 0

Hi again, I need help with redirecting without using headers in PHP, is there anyway to do it.

I know how to use headers but because I'm editing a pre-made site, there are many headers already being sent so I need to find another way around it. Anyone got any ideas?


ghost's Avatar
0 0

You could either echo a JS redirect or a meta redirect.


ghost's Avatar
0 0

What JJButler said.

<script>window.location="meatspin.com";</script>


ghost's Avatar
0 0

jjbutler88 wrote: You could either echo a JS redirect or a meta redirect.

Yeah I suppose I never thought about a javascript redirect. I thought about doing a META redirect but I was wondering if there was any other way.

xzebrax wrote: What JJButler said.

<script>window.location="meatspin.com";</script>

Yeah, Im really that stupid¬_¬

However thanks guys.


clone4's Avatar
Perl-6 Wisdom Seeker
0 0

you can always use htaccess ( Redirect /index.php http://google.com/), but I think that using meta tags would be much easier…


ghost's Avatar
0 0

Yeah ive gone with the meta tag idea. Its exactly what I wanted. Javascript's window.location seemed to redirect too fast I wanted the user to read the text before it redirected them too so meta's good.


Mouzi's Avatar
Member
0 0

You could've put the javascript redirection inside a setTimout to delay it.