Armenian Knowledge Base  

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

Reply
 
LinkBack Thread Tools
Old 12.06.2003, 13:42   #1
Web developer
 
Aram Ghazanchyan's Avatar
 
Join Date: 09 2002
Location: Yerevan
Age: 36
Posts: 896
Downloads: 1
Uploads: 0
Reputation: 9 | 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.
Reply With Quote
Old 13.06.2003, 06:11   #2
Web developer
 
Aram Ghazanchyan's Avatar
 
Join Date: 09 2002
Location: Yerevan
Age: 36
Posts: 896
Downloads: 1
Uploads: 0
Reputation: 9 | 0
Default

Warning: Cannot modify header information - headers already sent by
Reply With Quote
Old 13.06.2003, 06:36   #3
Магистр
 
Join Date: 02 2002
Location: Am
Posts: 952
Downloads: 0
Uploads: 0
Reputation: 26 | 4
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
Reply With Quote
Old 13.06.2003, 06:38   #4
»
 
z0mbie's Avatar
 
Join Date: 01 2002
Posts: 777
Downloads: 1
Uploads: 0
Reputation: 0 | 0
Default

до вызова header-а не должно быть никакого outputa(echo и т.п.)
Reply With Quote
Old 13.06.2003, 06:39   #5
Web developer
 
Aram Ghazanchyan's Avatar
 
Join Date: 09 2002
Location: Yerevan
Age: 36
Posts: 896
Downloads: 1
Uploads: 0
Reputation: 9 | 0
Default

setcookie(chto-to)
header(redirection)


V Cookie nichego ne pishetsya
Reply With Quote
Old 13.06.2003, 06:58   #6
»
 
z0mbie's Avatar
 
Join Date: 01 2002
Posts: 777
Downloads: 1
Uploads: 0
Reputation: 0 | 0
Default

setcookie это тоже header, все-таки проверь ещё раз есть ли до этого какой-либо output
Reply With Quote
Old 13.06.2003, 07:00   #7
»
 
z0mbie's Avatar
 
Join Date: 01 2002
Posts: 777
Downloads: 1
Uploads: 0
Reputation: 0 | 0
Default

кстати во время "Warning: Cannot modify header information - headers already sent by" должно показывать в которой строке output
Reply With Quote
Old 13.06.2003, 07:11   #8
Web developer
 
Aram Ghazanchyan's Avatar
 
Join Date: 09 2002
Location: Yerevan
Age: 36
Posts: 896
Downloads: 1
Uploads: 0
Reputation: 9 | 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
Reply With Quote
Old 13.06.2003, 07:42   #9
»
 
z0mbie's Avatar
 
Join Date: 01 2002
Posts: 777
Downloads: 1
Uploads: 0
Reputation: 0 | 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
Reply With Quote
Old 13.06.2003, 07:48   #10
Web developer
 
Aram Ghazanchyan's Avatar
 
Join Date: 09 2002
Location: Yerevan
Age: 36
Posts: 896
Downloads: 1
Uploads: 0
Reputation: 9 | 0
Default

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

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 23:19.


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