Get value from Cookie in PHP:
By using the following code you can retrieve the value stored in cookie. Here I'm using the global variable $_COOKIE to get the value stored in cookies.
Code:
By using the following code you can retrieve the value stored in cookie. Here I'm using the global variable $_COOKIE to get the value stored in cookies.
Code:
<?php setcookie( "cookiename", "cookievalue", time()+60000); $yourCookie = $_COOKIE["cookiename"]; if ( isset( $yourCookie ) ) echo "<p>Your cookie value is - $yourCookie</p>"; else echo "<p>Nothing in your cookie.</p>"; ?>
0 comments:
Post a Comment
Share your thoughts here...