Jump to content
php.lv forumi

cookies


born

Recommended Posts

Ir feedbaks, caur kuru var nosūtīt e-pastu kompānijai un tur ierastā procedura, ievadi datus, nosūti meilu, saņem automātisko apstiprinājumu uz e-pastu, ka e-pasts saņemts utt.

Lai saglabātu pēdējos ievadītos personas kontaktus izdomāju iecept tos iekš cepumiem/cookies šadi:

 

$cookie = $Name.":|:".$Surname.":|:".$Company.":|:".$Email.":|:".$Phone;

setcookie("cookie", $cookie);

 

bet testējot man met ārā šito paziņojumu:

 

Warning: Cannot modify header information - headers already sent by (output started at /home/d/dardedze/public_html/testmailform.php:15) in /home/d/dardedze/public_html/testmailform.php on line 317

 

Kas pa desām?

Link to comment
Share on other sites

Atveram: http://lv2.php.net/setcookie

un izlasam (otrais teikums):

Like other headers, cookies must be sent before any output from your script (this is a protocol restriction). This requires that you place calls to this function prior to any output, including <html> and <head> tags as well as any whitespace.

Vai šīs divas operācijas daudz laika prasīja?

Link to comment
Share on other sites

×
×
  • Create New...