Menu
We all know that js is only a frontend script and php is a backend script.
However, in js a statement such as
[code]
document.cookie = “DATA=”+data;
On the php side:
[code]
<?php
session_start();
echo $_COOKIE[‘DATA’];
?>
One can actually get data in php.
I am wondering how this work. Doesn’t the frontend js has to have some kind of mean like ajax to pass the data to the php backend? Thanks.