Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Tired of "headers already sent error?" here's a work around.

    jumpTo function is a wrapper for meta http-equiv="refresh"


    function parameters
    PHP Code:
    jumpTo(string $urlint $delay(seconds)) 
    function structure
    PHP Code:
    function jumpTo($url,$delay) {
        echo 
    '<meta http-equiv="refresh" content="'.htmlspecialchars($delay).'; URL='.htmlspecialchars($url).'">';

    example usage usage
    PHP Code:
    /*simple usage*/
    jumpTo("index.php",0); //immediately redirect to the index


    /*advanced usage*/
    $referer $_SERVER['HTTP_REFERER'];
    jumpTo($referer,0); 

  • #2
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,341
    Thanks
    13
    Thanked 349 Times in 345 Posts
    another workaround known as the IPO Model
    * get input
    * process input
    * output
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •