Go Back   Armenian Knowledge Base > Technical sections > Webmaster Zone > Web Development

Reply
 
Thread Tools

PHP: Header and Cookies problem
Old 12.06.2003, 12:42   #1
Web developer
 
Aram Ghazanchyan's Avatar
 
Join Date: 09 2002
Location: Yerevan
Age: 44
Posts: 896
Rep Power: 0
Default PHP: Header and Cookies problem

I have such problem:
If I use header("Location... for redirection, the system doesn't write Cookies, but if I use standart HTML redirection through META tags, all goes normal.

Old 13.06.2003, 05:11   #2
Web developer
 
Aram Ghazanchyan's Avatar
 
Join Date: 09 2002
Location: Yerevan
Age: 44
Posts: 896
Rep Power: 0
Default

Warning: Cannot modify header information - headers already sent by

Old 13.06.2003, 05:36   #3
Магистр
 
Join Date: 02 2002
Location: Am
Posts: 952
Rep Power: 5
Default

Quote:
Originally posted by Aram Ghazanchyan
Warning: Cannot modify header information - headers already sent by
esli ya pravil'no ponyal to etogo ti uje 4toto na ekran vivodi...

toest' do togo kak ti vizivaesh funkciyu header() nikakix vivodov ne dolno bit' do nego...

naprimer:

if(4toto){
echo( "vse ok");
header("poshel tuda to");
}
else{
echo("vse error");
header("poshel tuda to");
}

// Eto nepravil'nij kode..
__________________
talent agency casting.am
Center of Internet Projects Support http://www.online.am
Armenian newspapers digest http://www.armpress.com
_ _ _ _ _ _ _
Bud'te proshe i narod k vam potyanetca

Old 13.06.2003, 05:38   #4
»
 
z0mbie's Avatar
 
Join Date: 01 2002
Posts: 777
Rep Power: 0
Default

до вызова header-а не должно быть никакого outputa(echo и т.п.)

Old 13.06.2003, 05:39   #5
Web developer
 
Aram Ghazanchyan's Avatar
 
Join Date: 09 2002
Location: Yerevan
Age: 44
Posts: 896
Rep Power: 0
Default

setcookie(chto-to)
header(redirection)


V Cookie nichego ne pishetsya

Old 13.06.2003, 05:58   #6
»
 
z0mbie's Avatar
 
Join Date: 01 2002
Posts: 777
Rep Power: 0
Default

setcookie это тоже header, все-таки проверь ещё раз есть ли до этого какой-либо output

Old 13.06.2003, 06:00   #7
»
 
z0mbie's Avatar
 
Join Date: 01 2002
Posts: 777
Rep Power: 0
Default

кстати во время "Warning: Cannot modify header information - headers already sent by" должно показывать в которой строке output

Old 13.06.2003, 06:11   #8
Web developer
 
Aram Ghazanchyan's Avatar
 
Join Date: 09 2002
Location: Yerevan
Age: 44
Posts: 896
Rep Power: 0
Default

Sorry et Warning@ urish documenti mej er arajacel, vor@ vor dzer asacov chisht error er talis, hima mnac en harc@ vor Cookie-i mej chi grum, ete heto header em dnum.
Kstati, mi hat urish tegh em pordzrkel, UNIX-Apache er vren (im mot W2k/IIS-a), et tegh normal ashxatuma headernerov.
Im mot voch mi error chi talis, uxaki Cookie-i mej chi grum, indz tvuma et php.ini -i nastroykeqica

Old 13.06.2003, 06:42   #9
»
 
z0mbie's Avatar
 
Join Date: 01 2002
Posts: 777
Rep Power: 0
Default

может это ?

Code:
; Output buffering allows you to send header lines (including cookies) even
; after you send body content, at the price of slowing PHP's output layer a
; bit.  You can enable output buffering during runtime by calling the output
; buffering functions.  You can also enable output buffering for all files by
; setting this directive to On.  If you wish to limit the size of the buffer
; to a certain size - you can use a maximum number of bytes instead of 'On', as
; a value for this directive (e.g., output_buffering=4096).
output_buffering = Off

Old 13.06.2003, 06:48   #10
Web developer
 
Aram Ghazanchyan's Avatar
 
Join Date: 09 2002
Location: Yerevan
Age: 44
Posts: 896
Rep Power: 0
Default

Ha et porcel em, bayc de no effect, krome togo vor phpMyAdmin-@ sxal tvec inch vor
Reply




Реклама:
реклама
Buy text link .

All times are GMT. The time now is 15:40.
Top

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.