Hi
I have made this little piece of code, that saves a cookie called cookies, I want the value of cookie to be the value of the random quote (the page puts up a random quote on loading, from the text file quotes.txt) But if i put the setcookie line under the randomquote line, i get an error about header changing. I dont even know if i can do what i have done with the value of the cookie being $randomquote. Please can someone help me?
Thanks
Alex
Code:<?php setcookie ("cookies", $randomQuote); include("oneline_random_quote.php"); randomQuote("quotes.txt"); ?> <head> <body> <p> <? echo $_COOKIE["cookies"]; ?> </body> </head>




Reply With Quote