Zend - The PHP Company




Utilities

Add Code


URL Redirect  

Type: code fragment
Added by: nailufar
Entered: 20/10/2001
Last modified: 01/11/2000
Rating: *** (3 votes)
Views: 6283
you can not always sucess to use "header location" function if before this function you make a output, but don't worry you can make a little trick use javascript ....


<?

// ##################################################
// use this function to redirect to url you want
// but dont often 
// use it if header function is can't make solution
// your redirect ....
//
// happy scripting ...
// #################################################

function UrlRedirect($url) {
       
$str "
    <html>
        <script Language="
JavaScript">            
            window.location.href = "
$url";
        </script>
    </html>
    "
;
    
    print 
$str;
}

?>


Usage Example


<?

// you automatic redirect to zend.com
// after print "just test" :(

print "just test";
UrlRedirect("www.zend.com");

?>


Rate This Script





Search



This Category All Categories