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!
okay when someone trys to download a file from my page i want to search for a certain cookie. if the cookie is not there i dont want them to download the file and i want to display a message. if the cookie is there i want them to be able to download the file.
so if someone could help me with this coding it would be greatly appreciated
Take a look at the [php_man]setcookie()[/php_man] reference and the Predefined Variables specially $_COOKIE, play around, give it some try and then a couple more. Then if you still have trouble please come back here and we'll be very glad to help you.
using isset($_COOKIE['logged']) over $_COOKIE['logged'] should be done because a professional script should produce nearly zero errors, warnings, or notices in the logs.
feyd wrote:using isset($_COOKIE['logged']) over $_COOKIE['logged'] should be done because a professional script should produce nearly zero errors, warnings, or notices in the logs.
What errors, notices, warnings does it place in the logs?
lol thanks for backing me up feyd, error or not... its a more professional way to code and for a beginner, a nice way to start learning the proper way.
this doesn't help me any
you freaking rude slacker, go to php.net and read on isset() and setcookie()