User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,950 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,890 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 3292 | Replies: 6
Reply
Join Date: Jul 2005
Posts: 6
Reputation: Dheeraj Kumar is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Dheeraj Kumar Dheeraj Kumar is offline Offline
Newbie Poster

Wait some time and after that redirect another Location

  #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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2005
Location: Sheffield, UK
Posts: 294
Reputation: zippee is an unknown quantity at this point 
Rep Power: 4
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

  #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  
Join Date: Jul 2005
Posts: 6
Reputation: Dheeraj Kumar is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Dheeraj Kumar Dheeraj Kumar is offline Offline
Newbie Poster

Re: Wait some time and after that redirect another Location

  #3  
Sep 2nd, 2005
Thank you zippee


Rgds.
dheeraj
Reply With Quote  
Join Date: Apr 2005
Location: Auckland, New Zealand
Posts: 136
Reputation: sarahk is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
sarahk's Avatar
sarahk sarahk is offline Offline
Junior Poster

Re: Wait some time and after that redirect another Location

  #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  
Join Date: Apr 2005
Location: Auckland, New Zealand
Posts: 136
Reputation: sarahk is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
sarahk's Avatar
sarahk sarahk is offline Offline
Junior Poster

Re: Wait some time and after that redirect another Location

  #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  
Join Date: Sep 2005
Posts: 641
Reputation: digital-ether has a spectacular aura about digital-ether has a spectacular aura about 
Rep Power: 5
Solved Threads: 38
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Practically a Master Poster

Re: Wait some time and after that redirect another Location

  #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  
Join Date: Jul 2004
Posts: 191
Reputation: PoA is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 2
PoA PoA is offline Offline
Junior Poster

Re: Wait some time and after that redirect another Location

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 9:00 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC