header("location: http://...");

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 824
Joined: Sun Jun 02, 2002 3:09 am

Wed Apr 02, 2003 1:34 am

Òû óæå ïîñëàëà õåäåðè ,èõ íåëüçÿ ïîñûëàòü ïîñëå òîãî êàê òû íàïèøåøü ÷òî òî â áðàóçåðå...

User avatar
Redcircle
Moderator
Moderator
Posts: 826
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Wed Apr 02, 2003 5:24 pm

English please.

Osaou
New php-forum User
New php-forum User
Posts: 7
Joined: Tue Apr 15, 2003 4:52 pm
Location: Stockholm, Sweden
Contact:

Tue Apr 15, 2003 5:03 pm

First of all:
I understand enough french to know what you are asking...
Riiiight buddy, you don't know a word french, you were just reading his error message, that's what I say... ;)

But anyway... There is a way to keep php from sending all parsed material directly...

Code: Select all

ob_start();

If you call the above function at the top of the page, the parsed info will only be "flushed" (sent to the user) when the buffer exceeds its storage limit, at the end of the page, or when you command it to...

Happy php-ing... =)

This way you can use functions such as header() to send the user to another page when the script has already sent some html code...

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1279
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Tue Apr 15, 2003 11:56 pm

It is necessary to send any HTTP headers before you write any html

eg if you write

Code: Select all

echo('something');
header('location: http://somethihg');


This will create a error
hence do not write any html tag before the header info

Code: Select all

<?php
header('location: http://somethihg');


Oromian
New php-forum User
New php-forum User
Posts: 38
Joined: Fri Apr 04, 2003 2:44 pm
Location: Canada
Contact:

Wed Apr 16, 2003 4:04 am

http://www.altavista.com

translate! :roll:

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests