•
•
•
•
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
![]() |
•
•
Join Date: Jan 2005
Location: Sheffield, UK
Posts: 294
Reputation:
Rep Power: 4
Solved Threads: 6
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.
•
•
Join Date: Apr 2005
Location: Auckland, New Zealand
Posts: 136
Reputation:
Rep Power: 4
Solved Threads: 1
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.
•
•
Join Date: Apr 2005
Location: Auckland, New Zealand
Posts: 136
Reputation:
Rep Power: 4
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 <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
the problem is that you're using window.location not meta refresh. Search google. There are plenty of sites showing how to do it.
•
•
•
•
<?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!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
Similar Threads
- form submit redirect help, please (HTML and CSS)
- Execute Multiple Things At One Time (Visual Basic 4 / 5 / 6)
- Best way to build a LAN? (Networking Hardware Configuration)
- 2 questions: making a program wait, simulating the enter button (C#)
- php mail form - need to redirect to new page (PHP)
- WindowsXP makes me wait! (Windows NT / 2000 / XP / 2003)
- Is Redirect Bad for Business? (Search Engine Optimization)
- recording date and time a link is clicked (ASP.NET)
Other Threads in the PHP Forum
- Previous Thread: uploading a picture
- Next Thread: comparing 2 variable


Linear Mode