| | |
PHP cookies
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Dec 2006
Posts: 25
Reputation:
Solved Threads: 0
Can someone please help me I have made an example, of an cookies I have added a value 45 but i have created another page that displays. This prob is when i run the code that has the value 45 its suppose to give me a blank page byut i get this error on my browser
"Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\lesson\cookies\cookies.php:6) in C:\xampp\htdocs\lesson\cookies\cookies.php on line 11"
this is the code i put the cookie its suppose to just give a blank page but the value is stored in the cookie
"Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\lesson\cookies\cookies.php:6) in C:\xampp\htdocs\lesson\cookies\cookies.php on line 11"
this is the code i put the cookie its suppose to just give a blank page but the value is stored in the cookie
PHP Syntax (Toggle Plain Text)
<?php setcookie('test',45, time()+(60*60*24+7)); ?>
This is pretty common for programmers new to php. We'll need to see more code. Are you using echo or print before the header? Here's an article about the error.
Also any characters (even null or whitespace) before the opening <?php tag can also cause this error so make sure that your <?php starts at the very first line and column of your script.
In particular check line 6 (cookies.php:6) to see what you have that outputs there.
In particular check line 6 (cookies.php:6) to see what you have that outputs there.
Last edited by JRSofty; Mar 18th, 2008 at 4:46 am. Reason: Adding some info
JRSofty Programming | .NET Dreaming | GalahTech
If your question is solved then mark the thread solved. If someone gives you good advice then give them some rep.
If your question is solved then mark the thread solved. If someone gives you good advice then give them some rep.
![]() |
Similar Threads
- help with cookies (PHP)
- how to make member expire after so many days with php script (PHP)
- How Can I Pass A PHP Variable From One .php page to another (PHP)
- WEIRD! php pages do not load unless i hit refresh (PHP)
- Zend PHP Certification (PHP)
- how can i used session and cookies ??? (PHP)
- http://www.th.msie.cc/ index.php?aid=579 (Viruses, Spyware and other Nasties)
Other Threads in the PHP Forum
- Previous Thread: expired date validation and session
- Next Thread: Anyone who can help?
| Thread Tools | Search this Thread |
apache api archive array autocomplete beginner binary broken cakephp checkbox class cms code cron curl database dataentry date display duplicates dynamic ebooks echo email emptydisplayvalue error execute explodefunction file files firstoptioninphpdroplist folder form forms function functions google href htaccess html image include insert ip javasciptvalidation javascript joomla keywords limit link login mail matching mediawiki menu mlm multiple mysql number oop paypal pdf php phpincludeissue phpmyadmin problem query radio random recursion recursive remote script search server sessions shot sms source space speed sql subdomain subscription syntax system table tag tutorial tutorials update upload url validator variable vbulletin video web white youtube





