Never been to DZone Snippets before?

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

About this user

Robbie Trencheny robbiet.us

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Integrating reinvigorate name tags into a PHP site

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
   1  
   2  <FORM ACTION="index.php" METHOD="GET">
   3  <p>Name <INPUT TYPE=TEXT NAME= "n" SIZE=20><br>
   4  <INPUT TYPE=SUBMIT VALUE="Submit!">

Put this on your index.php page at the top before anything. This will set a cookie that will last for 2 months
   1  
   2  <?php
   3  $Name = $_GET['n'];
   4  ?>
   5  <?php
   6  $inTwoMonths = 60 * 60 * 24 * 60 + time(); 
   7  setcookie('name', $Name, $inTwoMonths); 
   8  ?>

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.
   1  
   2  <script type="text/javascript" src="http://include.reinvigorate.net/re_.js"></script>
   3  <script type="text/javascript">
   4  var re_name_tag = "<?php echo $Name; ?>";
   5  re_("USER-ID");
   6  </script>


« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS