PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
setcookie() defines a cookie to be sent along with the rest of the header information. Cookies must be sent before any other headers are sent (this is a restriction of cookies, not PHP).
See what I want to do is have a seperate stylesheet for each of the different resolutions. To do this I thought great idea, I would store there resolution in a cookie and then get the data from the cookie whereI would usually include the stylesheet. How else could I do this?
If you want to keep it similar to how it is, you'll have to do the whole thing in Javascript. If you don't know how to do cookies in Javascript see the advanced tutorial here:
I don't know if that is all of your code, or if you just pasted in a bit, but remember that Javascript should be 'commented out', so that at least in browsers that don't recognise Javascript, the code doesn't show on the visible page. Like this: