Create Cookie, Display Cookie, Read Cookie and Encryption Cookie In PHP Programming Language

in utopian-io •  7 years ago  (edited)

Create Cookie, Display Cookie, Read Cookie and Encryption Cookie In PHP Programming Language

PHP isan open source programming language.

What Will I Learn?

  • We will learn how to write the PHP language on the NotPad ++ program
  • We will learn how applications that we have done in PHP will work on LocalHost
  • We'll learn what COOKIEs are and how they are used in the PHP language
  • We will learn to create and save cookies in PHP. We will learn how to read cookies that we have created
    -We will learn Encryption COOKIE in PHP.
  • We will learn to display cookies in our browser
    -We will learn to delete cookies that we have created
    -We'll learn how to set how long cookies stay in our browser

Requirements

  • We need the WampServer program to run our applications on LocalHost in PHP language. It is open source application. we can download Wampserver here.
  • We need the NotPad ++ program to write our applications in PHP language. NotPAd++ is an open source program. We can download NotPad++ here
  • Windows 32-64

Difficulty

  • Intermediate

cookies.jpg

Tutorial Contents

We can write and save our applications in PHP language on NotPad ++ program. In the Requirements section you can download the program by clicking on the relevant link.

We can use the WampServer program to run applications that we have done in PHP language on LocalHost. We can download and use the relevant program by clicking the relevant link in the requirements section.

We can create COOKIE in PHP language. We can display the COOKIEs we created.

With COOKIE, we can find out which parts of the page users use the most.

resim.png

To run our applications through LocalHost, we store in the "www" folder in the "wamp" folder on the "c:" drive of our computer.

What IS COOKIE?

COOKIE is an application used to separate visitors from each other. We can use COOKIE if we want to know the visitors who visit our piles

We can make some surprise for our visitors.

We can develop the most visited sections

COOKIE's are small programs sent to their computers.

we can also added to the expiration date on cookies.

COOKIE can be cleaned whenever user wants.

resim.png

in the picture above; we choose php under the language for the programming in the php programming language.

<?php

error_reporting(0);

?>

in the codes above;

we add error_reporting to prevent unwanted errors.

resim.png

in the codes above;

we are using SETCOOKIE for the create COOKIE

wa are Encryption Cookie with the using md5

We are using time()+3600 for the add delay time on our cookies.

We are creating a new page for the read cookies.

resim.png

in the picture above;

We are using $_COOKIE code for the read cookies.

And we are creating a new page for the delete cookie.

<?php

ob_start();

echo "Cleaned Our Cookies";

setcookie("newcookie");

echo "Çerez Okuma Sayfasına Geri Dön";

ob_end_flush();

?>

in the codes above;

We are using ob_start() and ob_end_flush() codes for the delete our cookies.

And we create a link to return to the reading page.

Also we can display our cookies on the our browsers. For the Mozilla;

We are clicking settings,

Then we are clicking preferences,

Then we are clicking privacy and we are clicking show cookies on our browser.



Posted on Utopian.io - Rewarding Open Source Contributors

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order: