954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Wait some time and after that redirect another Location

when we use header for redirecting, it will be redirect immediatelly. so how can page is wait after the redirct another location.
I am request to all of u, if you have any suggession or code, please help me.

Rgds.
Dheeraj

Dheeraj Kumar
Newbie Poster
6 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

You can use sleep function before header('Location:http://xyz.com'). If just microsecond, then use usleep.

zippee
Posting Whiz in Training
294 posts since Jan 2005
Reputation Points: 10
Solved Threads: 7
 

Thank you zippee


Rgds.
dheeraj

Dheeraj Kumar
Newbie Poster
6 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

You may also want to have a holding page which has a meta refresh on it. This is a strategy used on forums and a great many sites.

sarahk
Junior Poster
144 posts since Apr 2005
Reputation Points: 10
Solved Threads: 1
 
Hi, I am using this code to redirecting another page. But still, it is not working. --------------------------------------------- <?php if(!$sql){ echo 'There has been an Error for Submitting your request. Please Contact the Web Master.'; }else{ echo "Hello ".$name.""; echo '
Thank you'; echo '

Your Request is under process. Our Representative will get in touch with you.'; sleep(5); echo ''; // header("Location: http://www.widecomindia.com/home.html"); } -------------------------------------------- if u have any example or suggession, please given reply. Rgds. Dheeraj

Hi Dheeraj - it's bad form to PM when you've already got a thread going...

the problem is that you're using window.location not meta refresh . Search google. There are plenty of sites showing how to do it.

sarahk
Junior Poster
144 posts since Apr 2005
Reputation Points: 10
Solved Threads: 1
 
<?php if(!$sql){ echo 'There has been an Error for Submitting your request. Please Contact the Web Master.'; }else{ echo "Hello ".$name.""; echo '
Thank you'; echo '

Your Request is under process. Our Representative will get in touch with you.'; sleep(5); echo ''; // header("Location: http://www.widecomindia.com/home.html"); }

You cannot use php to send a http redirect header after you have sent output to the browser.
This is limited by the http protocol.

You will have to use javascript, or the meta refresh method.

JS:

digital-ether
Nearly a Posting Virtuoso
Moderator
1,293 posts since Sep 2005
Reputation Points: 461
Solved Threads: 101
 

[PHP]header("Refresh: 3; http://www.yourdomain.com"); [/PHP]

Try replacing '3' with your choice. Hope it helps.

PoA
Posting Whiz in Training
237 posts since Jul 2004
Reputation Points: 26
Solved Threads: 9
 

echo '';

phpl0v3r
Newbie Poster
10 posts since Jul 2010
Reputation Points: 9
Solved Threads: 1
 

Thanks i also need this.

jogesh_p
Junior Poster in Training
68 posts since Sep 2010
Reputation Points: 16
Solved Threads: 6
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You