Page 1 of 1

silent redirect using php

Posted: Sun Mar 16, 2008 2:57 pm
by thewebdrivers
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

Re: silent redirect using php

Posted: Sun Mar 16, 2008 3:14 pm
by michaelh613
thewebdrivers 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
For example
header("Location: urlyouwantto use");

It's in the documentation here

http://us3.php.net/header

Re: silent redirect using php

Posted: Sun Mar 16, 2008 3:20 pm
by thewebdrivers
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

Posted: Sun Mar 16, 2008 5:39 pm
by anto91
Define silently, because if you want to edit the contents of the page in realtime you will need to use ajax

Re: silent redirect using php

Posted: Mon Mar 17, 2008 1:37 am
by thewebdrivers
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

Posted: Mon Mar 17, 2008 3:09 am
by Frank Shi
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!!

Re: silent redirect using php

Posted: Mon Mar 17, 2008 10:45 am
by Jonah Bron
Insert at first line of page:

Code: Select all

<?php
include('otherpage.php');
die();
?>

Re: silent redirect using php

Posted: Mon Mar 17, 2008 11:08 am
by thewebdrivers
i already overcame my problem. i used includes as i said. :-)

Thanks all for your help.