Jump to content

Problem in redirection using header


alishan

Recommended Posts

I need to redirect user after creating session or after saving data into the database.It does not work in php
after session. Is there any other way, please ?

[quote author=Hamlets666 link=topic=117719.msg480462#msg480462 date=1165498284]
[code]<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.phpfreaks.com/index.php">[/code]

Put it between between the <HEAD> and </HEAD>.
[/quote]
Link to comment
Share on other sites

Sorry, I actually just read that link and while it states the cause, it offers no solution.

The simplest solution is to use output buffering. This ensures that the headers are all sent together.

[code]
<?php
  ob_start();

  // your code

  ob_end_flush();
?>
[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.