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

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.

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.

Edited 3 Years Ago by pyTony: fixed formating

<?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>

This article has been dead for over six months. Start a new discussion instead.