DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Integrating Reinvigorate Name Tags Into A PHP Site

  • submit to reddit
        This is a script which will intergrate reinvigorate name tags into your PHP site using cookies
Put this on any page you want to have visitors enter their name
<FORM ACTION="index.php" METHOD="GET">
<p>Name <INPUT TYPE=TEXT NAME= "n" SIZE=20><br>
Put this on your index.php page at the top before anything. This will set a cookie that will last for 2 months
$Name = $_GET['n'];
$inTwoMonths = 60 * 60 * 24 * 60 + time(); 
setcookie('name', $Name, $inTwoMonths); 
Put this at the first line after the <body> tag. You need to change the USER-ID to your user ID that 
you can get from the regular reinvigorate code. 
<script type="text/javascript" src=""></script>
<script type="text/javascript">
var re_name_tag = "<?php echo $Name; ?>";