Hello there,
I don't know if this is possible or not but i want to make a silent redirect from one page to other based on condition specified in php code. I do not want the page url to change when redirecting. Since the condition is based in php code, i cannot use .htaccess
Any ideas? thanks in advance.
Regards
Mike
silent redirect using php
Moderator: General Moderators
-
thewebdrivers
- Forum Commoner
- Posts: 41
- Joined: Fri Aug 17, 2007 3:32 pm
- Location: india
- Contact:
-
michaelh613
- Forum Commoner
- Posts: 38
- Joined: Sun Mar 16, 2008 1:35 pm
Re: silent redirect using php
For examplethewebdrivers wrote:Hello there,
I don't know if this is possible or not but i want to make a silent redirect from one page to other based on condition specified in php code. I do not want the page url to change when redirecting. Since the condition is based in php code, i cannot use .htaccess
Any ideas? thanks in advance.
Regards
Mike
header("Location: urlyouwantto use");
It's in the documentation here
http://us3.php.net/header
-
thewebdrivers
- Forum Commoner
- Posts: 41
- Joined: Fri Aug 17, 2007 3:32 pm
- Location: india
- Contact:
Re: silent redirect using php
that will change the address bar, I do not want to change address bar and want to silently redirect to a new page.
Re: silent redirect using php
Define silently, because if you want to edit the contents of the page in realtime you will need to use ajax
-
thewebdrivers
- Forum Commoner
- Posts: 41
- Joined: Fri Aug 17, 2007 3:32 pm
- Location: india
- Contact:
Re: silent redirect using php
by silently, i meant redirecting to a different page without changing the url. i don't think its possible using php code so i have used includes and that did the job. anyways thanks for your help!!
Re: silent redirect using php
use imframe. I think it suit your qualifications
thewebdrivers wrote:by silently, i meant redirecting to a different page without changing the url. i don't think its possible using php code so i have used includes and that did the job. anyways thanks for your help!!
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: silent redirect using php
Insert at first line of page:
Code: Select all
<?php
include('otherpage.php');
die();
?>-
thewebdrivers
- Forum Commoner
- Posts: 41
- Joined: Fri Aug 17, 2007 3:32 pm
- Location: india
- Contact:
Re: silent redirect using php
i already overcame my problem. i used includes as i said. 
Thanks all for your help.
Thanks all for your help.