Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\desiorb\411.php:9) in C:\xampp\htdocs\desiorb\411.php on line 21
when I set a cookie on first page. Please help me fix it.
here is code fot both pages
411.php
Expand|Select|Wrap|Line Numbers
- <html>
- <body>
- <form action="411process.php" method="post">
- Email adddress: <input type="text" name="email" />
- Cell #: <input type="text" name="cell" />
- <input type="Submit" value = "Subscribe"/>
- <input type="checkbox" name="option_SportsPicks" value="SportsPicks" checked> SportsPicks
- <input type="checkbox" name="option_StockPicks" value="StockPicks" checked > Stock Picks
- <input type="checkbox" name="option_Wedding" value="Wedding" checked> Wedding
- <input type="checkbox" name="option_Tech" value="Tech" checked> Tech.
- <input type="checkbox" name="option_Fashion" value="Fashion" checked> Fashion
- <input type="checkbox" name="option_Events" value="Events" checked> Events
- <input type="checkbox" name="option_Entertainment" value="Entertainment" checked> Entertainment
- <input type="checkbox" name="option_RealEstate" value="RealEstate" checked> Real Estate
- <input type="checkbox" name="option_Auto" value="Auto" checked> Auto
- <input type="checkbox" name="option_Employment" value="Employment" checked> Employment
- <input type="checkbox" name="option_Cuisine" value="Cuisine" checked> Cuisine <br><br><br>
- </form>
- Sports
- <a href="411Directory.php" type="submit"><img src="buttons/sportspicks.png" alt="Sports Picks" name="sportspicks" id="sportspicks" onclick="411Process.php" border="0" ></a>
- <?php setcookie("id","sportspicks",time()+3600);?>
- Auto
- <a href="411Directory.php"><img src="buttons/auto.png" alt="auto" name="auto" id="Auto" border="0" ></a><br><br>
- Stock Picks
- <a href="411Directory.php"><img src="buttons/stockpicks.png" alt="stockpicks" name="stockpicks" id="stockpicks" border="0"></a>
- Events
- <a href="411Directory.php"><img src="buttons/events.png" alt="events" name="events" id="events" border="0"></a><br><br>
- Entertainment
- <a href="411Directory.php"><img src="buttons/entertainment.png" alt="entertainment" name="entertainment" id="entertainment" border="0"></a>
- Wedding
- <a href="411Directory.php"><img src="buttons/wedding.png" alt="wedding" name="wedding" id="wedding" border="0" ></a><br><br>
- Fashion
- <a href="411Directory.php"><img src="buttons/fashion.png" alt="fashion" name="fashion" id="fashion" border="0" ></a>
- Cuisine
- <a href="411Directory.php"><img src="buttons/cuisine.png" alt="cuisine" name="cuisine" id="cuisine" border="0"></a><br><br>
- Real Estate
- <a href="411Directory.php"><img src="buttons/realestate.png" alt="realestate" name="realestate" id="realestate" border="0"></a>
- Tech
- <a href="411Directory.php"><img src="buttons/tech.png" alt="tech" name="tech" id="tech" border="0"></a><br><br>
- Employment
- <a href="lastpage.htm"><img src="buttons/employment.png" alt="employment" name="employment" id="employment" border="0"></a>
- </body>
- </html>
Expand|Select|Wrap|Line Numbers
- <html>
- <body>
- <?php
- $id=$_COOKIE["id"];
- // Print a cookie
- echo $_COOKIE["id"];
- // A way to view all cookies
- print_r($_COOKIE);
- ?>
- </body>
- </html>
Please tell what I should do?
thanks in advance.