1.

How To Send A Cookie To The Browser?

Answer»

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","XYZ");
setcookie("PreferredColor","Blue");
print("2 cookies were delivered.\n");
?&GT;

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","XYZ");
setcookie("PreferredColor","Blue");
print("2 cookies were delivered.\n");
?>



Discussion

No Comment Found