<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: reinvigorate code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sun, 18 May 2008 08:57:30 GMT</pubDate>
    <description>DZone Snippets: reinvigorate code</description>
    <item>
      <title>Integrating reinvigorate name tags into a PHP site</title>
      <link>http://snippets.dzone.com/posts/show/4208</link>
      <description>This is a script which will intergrate reinvigorate name tags into your PHP site using cookies&lt;br /&gt;Put this on any page you want to have visitors enter their name&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;FORM ACTION="index.php" METHOD="GET"&gt;&lt;br /&gt;&lt;p&gt;Name &lt;INPUT TYPE=TEXT NAME= "n" SIZE=20&gt;&lt;br&gt;&lt;br /&gt;&lt;INPUT TYPE=SUBMIT VALUE="Submit!"&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Put this on your index.php page at the top before anything. This will set a cookie that will last for 2 months&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;$Name = $_GET['n'];&lt;br /&gt;?&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;$inTwoMonths = 60 * 60 * 24 * 60 + time(); &lt;br /&gt;setcookie('name', $Name, $inTwoMonths); &lt;br /&gt;?&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Put this at the first line after the &lt;body&gt; tag. You need to change the USER-ID to your user ID that &lt;br /&gt;you can get from the regular reinvigorate code. &lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;script type="text/javascript" src="http://include.reinvigorate.net/re_.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;br /&gt;var re_name_tag = "&lt;?php echo $Name; ?&gt;";&lt;br /&gt;re_("USER-ID");&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;</description>
      <pubDate>Mon, 25 Jun 2007 17:07:43 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4208</guid>
      <author>robbiet480 (Robbie Trencheny)</author>
    </item>
  </channel>
</rss>
