PHP

Topic: Cookies

How To Send a Cookie to the Browser?

If you want to sent a cookie to the browser when it comes to request your PHP page, you can use the setcookie( ) function. Note that you should call setcookie() function before any output statements. The following script shows you how to set cookies:<?php  setcookie("LoginName","FYICenter");  setcookie("PreferredColor","Blue");  print("2 cookies were delivered.\n");?>

Browse random answers: