PHP Cookies Example

PHP Cookies Example

In previous php tutorial we understood what is cookies and how to create, retrieve and destroy cookies in php.
Now, in this php tutorial we will take php form example for more understand about create cookies and delete cookies.

PHP cookies example

Here, we design php form with three textbox for name, age and city with three buttons for create cookies, retrieve cookies and delete cookies.

First, we enter some values in textbox for name, age and city then click create cookie button the cookies created on client computer. After creating cookies we retrieve cookies by clicking retrieve cookie button, when we click retrieve cookies button so all the values for name, age and city will be displayed on php form using echo statement. Then after click delete cookie button for delete cookies from users computer, After call delete button when we try to retrieve cookies values through retrieve cookie button, it will so the error message like “cookies deleted !!”.

The PHP form design code for cookies example.

When run above code the out put should be like :

PHP cookies example
PHP Cookies Example for create, retrieve and delete cookies.


(Visited 93 times, 1 visits today)

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha *