Question and answer is powered by AnsPress.io
I have saved input text value in cookie using jQuery in previous page. In the next page I want to display cookies values or store in a PHP variable. How can I print cookie values using php?
Set cookie use this code in jquery:
<script type="text/javascript"> $.cookie('my_id', value, { path: '/' }); </script>
Display cookie value in php
<?php if(!empty($_COOKIE["my_id"])){ echo $_COOKIE["my_id"]; }else{ echo "no value"; } ?>