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!
If output exists prior to calling this function, setcookie() will fail and return FALSE. If setcookie() successfully runs, it will return TRUE. This does not indicate whether the user accepted the cookie.
greree - exactly - on line 18 you echo something out, which is sending a whole load of headers to the browser and online 67 you're trying to set a cookie - which needs to change the headers, but it cannot because they've already been sent.
You cannot have it in this order, there is no other way to explain it.
I tried that, but I couldn't find any other place it would work even partially. It needs to trigger only if PayPal returns a successful purchase, and it needs to pick up the amount of the purchase, which is variable. I guess I'll just have to experiment. In the mean time I put a @ in front of the setcookie line so the error message would go away.
Try this idea: instead of echoing the output for the paypal image, just set a flag at that time indicating that it's set. Then, later, AFTER all your cookie and header work is done, you can perform the echo: