Home > Backend Development > PHP Tutorial > PHP code to read cookies set by javascript_PHP tutorial

PHP code to read cookies set by javascript_PHP tutorial

WBOY
Release: 2016-07-21 15:39:18
Original
869 people have browsed it

The code is given below:

Copy code The code is as follows:



The usage is like this
setmycookie('name'); This will set a cookie named name under the domain name
It is easier to read it with php.
Copy code The code is as follows:

$str = $_COOKIE('name'); //The parameters inside are the names set above
?>

Reprinted from 5D Happy Blog
Here are some related supplementary knowledge, in-depth friends can refer to it.
Javascript code for setting and reading cookies

Since we have not found a better collection of operating function codes for js cookies, you can refer to the next article for better content.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/321554.htmlTechArticleThe code is given below: Copy the code as follows: script language="JavaScript" type="text/javascript" function setmycookie (name) //Main parameters { $name = "thename"; $namev = test...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template