IES ACADEMY

IES ACADEMY
research

Translate

Popular Posts

Sign in with your
Google Account
Email:
ex: pat@example.com
Password:
Can't access your account?

Labels

education research blog

researc

researc
AI
Powered By Blogger

Search This Blog

WELCOME LINE

I AM IS NOTHING IN AI
» »Unlabelled » PHP and JavaScript


TBLOG 6:07 PM 0

Cookies: You can use cookies to store data on the client side that can be accessed by both PHP and JavaScript. Cookies are small text files that are stored in the browser and sent to the server with each request. Note: When using cookies, be mindful of the security implications, such as the sensitivity of the data being stored and transmitted, and follow best practices for handling and securing cookies. These are just a few examples of how you can communicate between PHP and JavaScript in a web application. The method you choose will depend on the specific requirements and constraints of your application. // PHP code to set a cookie setcookie('param1', 'value1', time() + 3600, '/'); // Cookie expires in 1 hour // PHP code to read a cookie $param1 = $_COOKIE['param1']; // JavaScript code to read a cookie var param1 = document.cookie.split(';').find(function(cookie) { return cookie.trim().startsWith('param1='); }); param1 = param1 ? param1.split('=')[1] : null;

«
Next
Newer Post
»
Previous
Older Post

No comments

Leave a Reply