Wait some time and after that redirect another Location

Reply

Join Date: Jul 2005
Posts: 6
Reputation: Dheeraj Kumar is an unknown quantity at this point 
Solved Threads: 0
Dheeraj Kumar Dheeraj Kumar is offline Offline
Newbie Poster

Wait some time and after that redirect another Location

 
0
  #1
Sep 1st, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 294
Reputation: zippee is an unknown quantity at this point 
Solved Threads: 6
zippee's Avatar
zippee zippee is offline Offline
Posting Whiz in Training

Re: Wait some time and after that redirect another Location

 
0
  #2
Sep 1st, 2005
You can use sleep function before header('Location:http://xyz.com'). If just microsecond, then use usleep.
Ecommerce-Web-Store.com Building Your e-Business.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 6
Reputation: Dheeraj Kumar is an unknown quantity at this point 
Solved Threads: 0
Dheeraj Kumar Dheeraj Kumar is offline Offline
Newbie Poster

Re: Wait some time and after that redirect another Location

 
0
  #3
Sep 2nd, 2005
Thank you zippee


Rgds.
dheeraj
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 138
Reputation: sarahk is an unknown quantity at this point 
Solved Threads: 1
sarahk's Avatar
sarahk sarahk is offline Offline
Junior Poster

Re: Wait some time and after that redirect another Location

 
0
  #4
Sep 2nd, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 138
Reputation: sarahk is an unknown quantity at this point 
Solved Threads: 1
sarahk's Avatar
sarahk sarahk is offline Offline
Junior Poster

Re: Wait some time and after that redirect another Location

 
0
  #5
Sep 2nd, 2005
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 <u><b>".$name."</b></u>";
echo '<br/><hr>Thank you';
echo '<br/><br/>Your Request is under process. Our Representative will get in touch with you.';
sleep(5);
echo '<script><!-- window.location= "http://www.widecomindia.com/home.html" //--></script>';
// 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.
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 1,081
Reputation: digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice 
Solved Threads: 66
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Veteran Poster

Re: Wait some time and after that redirect another Location

 
0
  #6
Sep 28th, 2005
<?php
if(!$sql){
echo 'There has been an Error for Submitting your request. Please Contact the Web Master.';
}else{
echo "Hello <u><b>".$name."</b></u>";
echo '<br/><hr>Thank you';
echo '<br/><br/>Your Request is under process. Our Representative will get in touch with you.';
sleep(5);
echo '<script><!-- window.location= "http://www.widecomindia.com/home.html" //--></script>';
// 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:

<script>
<!--
timeout = '5000'; // milliseconds/1000th of a sec
window.onload = setTimeout(myRedirect, timeout); // ensure we load the whole page

function myRedirect() {

window.location = "http://www.widecomindia.com/home.html";
}
//-->
</script>
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 234
Reputation: PoA is an unknown quantity at this point 
Solved Threads: 8
PoA PoA is offline Offline
Posting Whiz in Training

Re: Wait some time and after that redirect another Location

 
0
  #7
Sep 29th, 2005
[PHP]header("Refresh: 3; http://www.yourdomain.com"); [/PHP]

Try replacing '3' with your choice. Hope it helps.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC