Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

set cookie on button click JavaScript


function SetCookie(c_name,value,expiredays)
	{
		var exdate=new Date()
		exdate.setDate(exdate.getDate()+expiredays)
		document.cookie=c_name+ "=" +escape(value)+
		((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
	}

Source by www.sitepoint.com #
 
PREVIOUS NEXT
Tagged: #set #cookie #button #click #JavaScript
ADD COMMENT
Topic
Name
4+3 =