Saturday, January 1, 2011

PHP Redirect Problem

  header() is used to send a raw HTTP header.

  header( ‘Location:’ ) ;

This function must be called before any actual output is sent unless you will get the following error:

    Warning: Cannot modify header information – headers already sent by

Or you can use ob_start() and ob_flush() function to avoid this problem by buffering the output.

    echo “Test”;
    header( ‘Location:’ ) ;

Using JavaScript

<script type="text/javascript">
window.location = ""

No comments:

Post a Comment