Hi I'm just wondering if it's possible to store the custom data attribute of an element with PHP into a variable and use that variable after refreshing the page?
I am trying to store this <a>
tag's data attribute within a variable when it is pressed.
Here is an example of the element:
<a href="/book-testdrive" class="addtocart" data-value="NH06LKO" title="Book Test Drive">
<span> Book Test Drive</span>
</a>
So I'm wondering if I can post the value of the data-value
attribute when the <a>
tag is clicked to a variable and store it on the server so it can be used after a page reload.
Is this possible with PHP?
Thanks, Nick