<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>gigaspartan</title>
	<atom:link href="http://gigaspartan.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://gigaspartan.com</link>
	<description>You source for web news and answers.</description>
	<pubDate>Sun, 28 Jun 2009 06:17:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
			<item>
		<title>Back, once again!</title>
		<link>http://gigaspartan.com/?p=11</link>
		<comments>http://gigaspartan.com/?p=11#comments</comments>
		<pubDate>Sun, 28 Jun 2009 06:17:37 +0000</pubDate>
		<dc:creator>Pat</dc:creator>
		
		<category><![CDATA[Posts]]></category>

		<guid isPermaLink="false">http://gigaspartan.com/?p=11</guid>
		<description><![CDATA[Well, dear readers, I have not been active on this blog for quite some time. I have noticed that there are alot of commenters requesting support. I will be posting all new tutorials that are soon to come. I will update the user system script, and also I will be taking suggestions for new tutorials. [...]]]></description>
			<content:encoded><![CDATA[<p>Well, dear readers, I have not been active on this blog for quite some time. I have noticed that there are alot of commenters requesting support. I will be posting all new tutorials that are soon to come. I will update the user system script, and also I will be taking suggestions for new tutorials. Just comment on this post and I will get those tutorials up ASAP. Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://gigaspartan.com/?feed=rss2&amp;p=11</wfw:commentRss>
		</item>
		<item>
		<title>Long lost posts&#8230;</title>
		<link>http://gigaspartan.com/?p=10</link>
		<comments>http://gigaspartan.com/?p=10#comments</comments>
		<pubDate>Mon, 25 Aug 2008 16:23:19 +0000</pubDate>
		<dc:creator>Pat</dc:creator>
		
		<category><![CDATA[Posts]]></category>

		<guid isPermaLink="false">http://gigaspartan.com/?p=10</guid>
		<description><![CDATA[Hello again, as you may know, I have not been updating this site for a long time now. The truth is, I just have not had any time to create tutorials. I just got back from a long and needed vacation, and will be heading to school in a few weeks. I hope that I [...]]]></description>
			<content:encoded><![CDATA[<p>Hello again, as you may know, I have not been updating this site for a long time now. The truth is, I just have not had any time to create tutorials. I just got back from a long and needed vacation, and will be heading to school in a few weeks. I hope that I can still post when I get the chance. As for now, I am working on the membership tutorial bugs that you all have been posting about, and would like to update that asap. Any tutorials that you would like to see here, post a comment in this thread.</p>
<p>Thanks</p>
]]></content:encoded>
			<wfw:commentRss>http://gigaspartan.com/?feed=rss2&amp;p=10</wfw:commentRss>
		</item>
		<item>
		<title>Coming Soon&#8230;</title>
		<link>http://gigaspartan.com/?p=9</link>
		<comments>http://gigaspartan.com/?p=9#comments</comments>
		<pubDate>Sat, 28 Jun 2008 05:17:31 +0000</pubDate>
		<dc:creator>Pat</dc:creator>
		
		<category><![CDATA[Posts]]></category>

		<guid isPermaLink="false">http://gigaspartan.com/?p=9</guid>
		<description><![CDATA[I am leaving for Italy on a cruise this weekend. I will be gone until the following weekend. I have reviewed all of the comments I have received and when I come back, I will post the following tutorials:
1) PHP Poll System
2) PHP Gallery System
3) Securing PHP scripts
And possibly if I have time, expand on [...]]]></description>
			<content:encoded><![CDATA[<p>I am leaving for Italy on a cruise this weekend. I will be gone until the following weekend. I have reviewed all of the comments I have received and when I come back, I will post the following tutorials:</p>
<p>1) PHP Poll System<br />
2) PHP Gallery System<br />
3) Securing PHP scripts</p>
<p>And possibly if I have time, expand on the membership system.</p>
<p>Post any other requests you might have <img src='http://gigaspartan.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://gigaspartan.com/?feed=rss2&amp;p=9</wfw:commentRss>
		</item>
		<item>
		<title>Tutorial: PHP/mySQL Simple User Counter</title>
		<link>http://gigaspartan.com/?p=8</link>
		<comments>http://gigaspartan.com/?p=8#comments</comments>
		<pubDate>Fri, 06 Jun 2008 03:05:30 +0000</pubDate>
		<dc:creator>Pat</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[mySQL]]></category>

		<guid isPermaLink="false">http://gigaspartan.com/?p=8</guid>
		<description><![CDATA[Today I am going to show you how to make a simple user counter with total and unique hit statistics. This is just a simple script tutorials so you will be able to build upon it.
Let set up our database structure:

View Code PHP1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
&#60;?php
// This is how your DB will be setup.
/*
CREATE TABLE IF NOT EXISTS [...]]]></description>
			<content:encoded><![CDATA[<p>Today I am going to show you how to make a simple user counter with total and unique hit statistics. This is just a simple script tutorials so you will be able to build upon it.</p>
<p>Let set up our database structure:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p8code5'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p85"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code" id="p8code5"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// This is how your DB will be setup.</span>
<span style="color: #666666; font-style: italic;">/*
CREATE TABLE IF NOT EXISTS `visitors` (
  `visitor_id` int(11) NOT NULL auto_increment,
  `name` varchar(225) NOT NULL default '',
  `value` varchar(225) NOT NULL default '',
  PRIMARY KEY  (`visitor_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
&nbsp;
INSERT INTO `visitors` (`visitor_id`, `name`, `value`) VALUES
(1, 'ip', ''),
(2, 'hits', '0,0');
*/</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Now to call the database in conf.inc.php:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p8code6'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p86"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
</pre></td><td class="code" id="p8code6"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$db_user</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span>; <span style="color: #666666; font-style: italic;">// Username</span>
<span style="color: #000088;">$db_pass</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span>; <span style="color: #666666; font-style: italic;">// Password</span>
<span style="color: #000088;">$db_database</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span>; <span style="color: #666666; font-style: italic;">// Database Name</span>
<span style="color: #000088;">$db_host</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span>; <span style="color: #666666; font-style: italic;">// Server Hostname</span>
<span style="color: #000088;">$db_connect</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_connect"><span style="color: #990000;">mysql_connect</span></a> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$db_host</span><span style="color: #339933;">,</span> <span style="color: #000088;">$db_user</span><span style="color: #339933;">,</span> <span style="color: #000088;">$db_pass</span><span style="color: #009900;">&#41;</span>;
<span style="color: #000088;">$db_select</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_select_db"><span style="color: #990000;">mysql_select_db</span></a> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$db_database</span><span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">// Code to pull the results from the db.</span>
<span style="color: #000088;">$q</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT * FROM `visitors` WHERE `name` = 'hits'&quot;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Finds the row with the numbers</span>
<span style="color: #000088;">$visitor</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_fetch_array"><span style="color: #990000;">mysql_fetch_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$q</span><span style="color: #009900;">&#41;</span>;
<span style="color: #000088;">$visitor</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/split"><span style="color: #990000;">split</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;,&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$visitor</span><span style="color: #009900;">&#91;</span><span style="">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Splits the query result into an array.</span>
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="">'SITE_HITS'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$visitor</span><span style="color: #009900;">&#91;</span><span style="">'0'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">//  Defines a constant for all hits</span>
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="">'SITE_UNI_HITS'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$visitor</span><span style="color: #009900;">&#91;</span><span style="">'1'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Defines a constant for unique hits</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> visitor<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ip</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// Function that will be put on main page.</span>
	<span style="color: #000088;">$q_ip</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT * FROM `visitors` WHERE `name` = 'ip'&quot;</span><span style="color: #009900;">&#41;</span> or <a href="http://www.php.net/die"><span style="color: #990000;">die</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/mysql_error"><span style="color: #990000;">mysql_error</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Finds the info for all of the ip's</span>
	<span style="color: #000088;">$r_ip</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_fetch_array"><span style="color: #990000;">mysql_fetch_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$q_ip</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Fetches the ip array we will use later.</span>
	<span style="color: #000088;">$array_ip</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/split"><span style="color: #990000;">split</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$r_ip</span><span style="color: #009900;">&#91;</span><span style="">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Splits the results and turns it into an array of all the ips</span>
&nbsp;
	<span style="color: #000088;">$q_hit</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT * FROM `visitors` WHERE `name` = 'hits'&quot;</span><span style="color: #009900;">&#41;</span> or <a href="http://www.php.net/die"><span style="color: #990000;">die</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/mysql_error"><span style="color: #990000;">mysql_error</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Finds the info for the hits</span>
	<span style="color: #000088;">$r_hit</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_fetch_array"><span style="color: #990000;">mysql_fetch_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$q_hit</span><span style="color: #009900;">&#41;</span>;
	<span style="color: #000088;">$hit</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/split"><span style="color: #990000;">split</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;,&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$r_hit</span><span style="color: #009900;">&#91;</span><span style="">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Splits the query results into an array.</span>
	<span style="color: #000088;">$hits</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$hit</span><span style="color: #009900;">&#91;</span><span style="">'0'</span><span style="color: #009900;">&#93;</span>; <span style="color: #666666; font-style: italic;">// The total hits</span>
	<span style="color: #000088;">$uni</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$hit</span><span style="color: #009900;">&#91;</span><span style="">'1'</span><span style="color: #009900;">&#93;</span>; <span style="color: #666666; font-style: italic;">// The unique hits</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/in_array"><span style="color: #990000;">in_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ip</span><span style="color: #339933;">,</span> <span style="color: #000088;">$array_ip</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// If the users ip is in the array we defined earlier</span>
		<span style="color: #000088;">$hits</span>++; <span style="color: #666666; font-style: italic;">// Adds a hit, but not a unique hit</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$hits</span>++; <span style="color: #666666; font-style: italic;">// Adds both a unique and hit because he is a new user.</span>
		<span style="color: #000088;">$uni</span>++;
		<span style="color: #000088;">$ip</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$r_ip</span><span style="color: #009900;">&#91;</span><span style="">'value'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$ip</span>; <span style="color: #666666; font-style: italic;">// Adds the new ip to the ips already in the db</span>
		<a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;UPDATE `visitors` SET `value` = '$ip' WHERE `name` = 'ip'&quot;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Updates the table</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000088;">$hits</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$hits</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;,&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$uni</span>; <span style="color: #666666; font-style: italic;">// Combines the hits and unique hits</span>
	<a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;UPDATE `visitors` SET `value` = '$hits' WHERE `name` = 'hits'&quot;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Updates the table</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Breakdown:<br />
First we set the db info.<br />
Next we define the hit/unique constants to display it on the stats page.<br />
After we create the function visitors to add the users ip and hits into the db.</p>
<p>Now the code you would put in the index.php or the page you want the stats for.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p8code7'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p87"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p8code7"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;conf.inc.php&quot;</span><span style="color: #009900;">&#41;</span>;
visitor<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;REMOTE_ADDR&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Use the function we defined earlier with the users ip.</span>
<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;Main page&quot;</span>;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Breakdown:<br />
First we include the conf.inc.php for the db info and the functions.<br />
Next we initiate the function visitors with the users ip.</p>
<p>Now for the stats.php page:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p8code8'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p88"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p8code8"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;conf.inc.php&quot;</span><span style="color: #009900;">&#41;</span>;
<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;Total Hits: &quot;</span> <span style="color: #339933;">.</span> SITE_HITS;
<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span>;
<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;Unique Hits: &quot;</span> <span style="color: #339933;">.</span> SITE_UNI_HITS;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>And thats it, I hope you build off it. If you have any questions please feel free to post. Thanks</p>
]]></content:encoded>
			<wfw:commentRss>http://gigaspartan.com/?feed=rss2&amp;p=8</wfw:commentRss>
		</item>
		<item>
		<title>Tutorial: PHP/mySQL Simple IP Banning</title>
		<link>http://gigaspartan.com/?p=7</link>
		<comments>http://gigaspartan.com/?p=7#comments</comments>
		<pubDate>Wed, 28 May 2008 22:11:40 +0000</pubDate>
		<dc:creator>Pat</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[mySQL]]></category>

		<guid isPermaLink="false">http://gigaspartan.com/?p=7</guid>
		<description><![CDATA[Today I am going to show you how to create an IP ban system. This does not include an IP manager, although if I receive enough requests, I will. 
To start things off we need to create the page conf.inc.php. This page will be included in all the pages and contain the ban function and [...]]]></description>
			<content:encoded><![CDATA[<p>Today I am going to show you how to create an IP ban system. This does not include an IP manager, although if I receive enough requests, I will. </p>
<p>To start things off we need to create the page conf.inc.php. This page will be included in all the pages and contain the ban function and database details.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p7code11'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p711"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code" id="p7code11"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$db_user</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span>; <span style="color: #666666; font-style: italic;">// Username</span>
<span style="color: #000088;">$db_pass</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span>; <span style="color: #666666; font-style: italic;">// Password</span>
<span style="color: #000088;">$db_database</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span>; <span style="color: #666666; font-style: italic;">// Database Name</span>
<span style="color: #000088;">$db_host</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span>; <span style="color: #666666; font-style: italic;">// Server Hostname</span>
<span style="color: #000088;">$db_connect</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_connect"><span style="color: #990000;">mysql_connect</span></a> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$db_host</span><span style="color: #339933;">,</span> <span style="color: #000088;">$db_user</span><span style="color: #339933;">,</span> <span style="color: #000088;">$db_pass</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Connects the the database</span>
<span style="color: #000088;">$db_select</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_select_db"><span style="color: #990000;">mysql_select_db</span></a> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$db_database</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Selects the DB we will be searching in.</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// IP Ban Check</span>
<span style="color: #000000; font-weight: bold;">function</span> is_banned<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ip</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// Starts the is_banned function.</span>
	<span style="color: #000088;">$q</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT * FROM `ban` WHERE `ip` = '$ip'&quot;</span><span style="color: #009900;">&#41;</span> or <a href="http://www.php.net/die"><span style="color: #990000;">die</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/mysql_error"><span style="color: #990000;">mysql_error</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Searches the database for the users ip.</span>
	<span style="color: #000088;">$rows</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_num_rows"><span style="color: #990000;">mysql_num_rows</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$q</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Counts all the results found.</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$rows</span> <span style="color: #339933;">&gt;</span> <span style="color:#800080;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// If more than 0 were found.</span>
		<span style="color: #000088;">$banned</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">true</span>; <span style="color: #666666; font-style: italic;">// The user is banned.</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$banned</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">false</span>; <span style="color: #666666; font-style: italic;">// The user is not banned.</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$banned</span>;
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Breakdown:<br />
We 1st connect the the database in order to retrieve data.<br />
Then we create the function called is_banned() to check if the users ip is in the ban list.</p>
<p>Now we will implement this code in index.php.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p7code12'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p712"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code" id="p7code12"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;conf.inc.php&quot;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Include the database and function details.</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_banned<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;REMOTE_ADDR&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// Start out function with the users ip.</span>
	<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;Error: You have been banned from this website!&quot;</span>; <span style="color: #666666; font-style: italic;">// The user is banned.</span>
	<a href="http://www.php.net/exit"><span style="color: #990000;">exit</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Halts the rest of the script from performing.</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;You have not been banned, congrats on not being one of the many assholes.&quot;</span>;
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Now that script is not complex, but it is so you can build on it. I hope this was helpful to you. As always, if you have any questions, please feel free to ask.</p>
]]></content:encoded>
			<wfw:commentRss>http://gigaspartan.com/?feed=rss2&amp;p=7</wfw:commentRss>
		</item>
		<item>
		<title>Tutorial: PHP/mySQL Membership System</title>
		<link>http://gigaspartan.com/?p=6</link>
		<comments>http://gigaspartan.com/?p=6#comments</comments>
		<pubDate>Wed, 28 May 2008 20:43:28 +0000</pubDate>
		<dc:creator>Pat</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[mySQL]]></category>

		<guid isPermaLink="false">http://75.125.133.162/~giga/?p=6</guid>
		<description><![CDATA[Hi, today I am going to show you how to make a simple membership system. This included, registering for an account, logging in, security for pages, and logging out.
Now shall we begin? I say yes!
Our database will be setup like the following:

View Code MYSQL1
2
3
4
5
6
7
CREATE TABLE IF NOT EXISTS `users` &#40;
  `user_id` int&#40;11&#41; NOT NULL [...]]]></description>
			<content:encoded><![CDATA[<p>Hi, today I am going to show you how to make a simple membership system. This included, registering for an account, logging in, security for pages, and logging out.</p>
<p>Now shall we begin? I say yes!</p>
<p>Our database will be setup like the following:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p6code19'); return false;">View Code</a> MYSQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p619"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p6code19"><pre class="mysql mysql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE TABLE</span> IF <span style="color: #aa3399; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">EXISTS</span> `users` <span style="color: #66cc66;">&#40;</span>
  `user_id` <span style="color: #aa9933; font-weight: bold;">int</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">11</span><span style="color: #66cc66;">&#41;</span> <span style="color: #aa3399; font-weight: bold;">NOT NULL</span> <span style="color: #aa3399; font-weight: bold;">auto_increment</span>,
  `username` <span style="color: #aa9933; font-weight: bold;">varchar</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">225</span><span style="color: #66cc66;">&#41;</span> <span style="color: #aa3399; font-weight: bold;">NOT NULL</span> <span style="color: #aa3399; font-weight: bold;">default</span> <span style="color: #ff0000;">''</span>,
  `password` <span style="color: #aa9933; font-weight: bold;">varchar</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">225</span><span style="color: #66cc66;">&#41;</span> <span style="color: #aa3399; font-weight: bold;">NOT NULL</span> <span style="color: #aa3399; font-weight: bold;">default</span> <span style="color: #ff0000;">''</span>,
  `email` <span style="color: #aa9933; font-weight: bold;">varchar</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">225</span><span style="color: #66cc66;">&#41;</span> <span style="color: #aa3399; font-weight: bold;">NOT NULL</span> <span style="color: #aa3399; font-weight: bold;">default</span> <span style="color: #ff0000;">''</span>,
  <span style="color: #993333; font-weight: bold;">PRIMARY KEY</span>  <span style="color: #66cc66;">&#40;</span>`user_id`<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span> ENG<span style="color: #66cc66;">IN</span>E<span style="color: #66cc66;">=</span>My<span style="color: #66cc66;">IS</span>AM <span style="color: #aa3399; font-weight: bold;">DEFAULT</span> <span style="color: #aa3399; font-weight: bold;">CHARSET</span><span style="color: #66cc66;">=</span>latin1 <span style="color: #aa3399; font-weight: bold;">AUTO_INCREMENT</span><span style="color: #66cc66;">=</span><span style="color: #cc66cc;">1</span> ;</pre></td></tr></table></div>

<p>Breakdown:<br />
     user_id is the default value that keeps track of users.<br />
     username is the users log in name.<br />
     password is the users log in password.<br />
     email is the users email, so in later versions of the member system, a forgot password can be added.</p>
<p>Our 1st bit of code will be a file named conf.inc.php. This file holds all of our mysql and function data, so we don&#8217;t have to enter it over and over :D.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p6code20'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p620"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code" id="p6code20"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$db_user</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span>; <span style="color: #666666; font-style: italic;">// Username</span>
<span style="color: #000088;">$db_pass</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span>; <span style="color: #666666; font-style: italic;">// Password</span>
<span style="color: #000088;">$db_database</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span>; <span style="color: #666666; font-style: italic;">// Database Name</span>
<span style="color: #000088;">$db_host</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span>; <span style="color: #666666; font-style: italic;">// Server Hostname</span>
<span style="color: #000088;">$db_connect</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_connect"><span style="color: #990000;">mysql_connect</span></a> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$db_host</span><span style="color: #339933;">,</span> <span style="color: #000088;">$db_user</span><span style="color: #339933;">,</span> <span style="color: #000088;">$db_pass</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Connects to the database.</span>
<span style="color: #000088;">$db_select</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_select_db"><span style="color: #990000;">mysql_select_db</span></a> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$db_database</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Selects the database.</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> form<span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// Prevents SQL Injection</span>
   <a href="http://www.php.net/global"><span style="color: #990000;">global</span></a> <span style="color: #000088;">$db_connect</span>;
   <span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/ereg_replace"><span style="color: #990000;">ereg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;[<span style="color: #000099; font-weight: bold;">\'</span><span style="color: #000099; font-weight: bold;">\&quot;</span>)(;|`,&lt;&gt;]&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span>;
   <span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_real_escape_string"><span style="color: #990000;">mysql_real_escape_string</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/trim"><span style="color: #990000;">trim</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$db_connect</span><span style="color: #009900;">&#41;</span>;
   <span style="color: #b1b100;">return</span> <a href="http://www.php.net/stripslashes"><span style="color: #990000;">stripslashes</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Breakdown:<br />
     The 1st part is all the mySQL information in order to view and insert data.<br />
     The 2nd part prevents SQL injection, so people cant gain unauthorized access.</p>
<p>Our next file will be register.php, it will allow users to register an account so they may login and view parts of the website that others cant.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p6code21'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p621"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
</pre></td><td class="code" id="p6code21"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;conf.inc.php&quot;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Includes the db and form info.</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="">'submit'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// If the form has not been submitted.</span>
	<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;form action=<span style="color: #000099; font-weight: bold;">\&quot;</span>register.php<span style="color: #000099; font-weight: bold;">\&quot;</span> method=<span style="color: #000099; font-weight: bold;">\&quot;</span>POST<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span>;
	<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;table&gt;&quot;</span>;
	<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;tr&gt;&quot;</span>;
	<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;td colspan=<span style="color: #000099; font-weight: bold;">\&quot;</span>2<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Register:&lt;/td&gt;&quot;</span>;
	<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;/tr&gt;&quot;</span>;
	<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;tr&gt;&quot;</span>;
	<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;td width=<span style="color: #000099; font-weight: bold;">\&quot;</span>50%<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Username:&lt;/td&gt;&lt;td width=<span style="color: #000099; font-weight: bold;">\&quot;</span>50%<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;input name=<span style="color: #000099; font-weight: bold;">\&quot;</span>username<span style="color: #000099; font-weight: bold;">\&quot;</span> size=<span style="color: #000099; font-weight: bold;">\&quot;</span>18<span style="color: #000099; font-weight: bold;">\&quot;</span> type=<span style="color: #000099; font-weight: bold;">\&quot;</span>text<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span>;
	<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;/tr&gt;&quot;</span>;
	<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;tr&gt;&quot;</span>;
	<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;td width=<span style="color: #000099; font-weight: bold;">\&quot;</span>50%<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Password:&lt;/td&gt;&lt;td width=<span style="color: #000099; font-weight: bold;">\&quot;</span>50%<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;input name=<span style="color: #000099; font-weight: bold;">\&quot;</span>password<span style="color: #000099; font-weight: bold;">\&quot;</span> size=<span style="color: #000099; font-weight: bold;">\&quot;</span>18<span style="color: #000099; font-weight: bold;">\&quot;</span> type=<span style="color: #000099; font-weight: bold;">\&quot;</span>text<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span>;
	<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;/tr&gt;&quot;</span>;
	<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;tr&gt;&quot;</span>;
	<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;td width=<span style="color: #000099; font-weight: bold;">\&quot;</span>50%<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Email:&lt;/td&gt;&lt;td width=<span style="color: #000099; font-weight: bold;">\&quot;</span>50%<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;input name=<span style="color: #000099; font-weight: bold;">\&quot;</span>email<span style="color: #000099; font-weight: bold;">\&quot;</span> size=<span style="color: #000099; font-weight: bold;">\&quot;</span>18<span style="color: #000099; font-weight: bold;">\&quot;</span> type=<span style="color: #000099; font-weight: bold;">\&quot;</span>text<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span>;
	<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;/tr&gt;&quot;</span>;
	<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;tr&gt;&quot;</span>;
	<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;td colspan=<span style="color: #000099; font-weight: bold;">\&quot;</span>2<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>submit<span style="color: #000099; font-weight: bold;">\&quot;</span> name=<span style="color: #000099; font-weight: bold;">\&quot;</span>submit<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>submit<span style="color: #000099; font-weight: bold;">\&quot;</span>&lt;/td&gt;&quot;</span>;
	<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;/tr&gt;&quot;</span>;
	<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;/table&gt;&quot;</span>;
	<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;/form&gt;&quot;</span>;
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// The form has been submitted.</span>
	<span style="color: #000088;">$username</span> <span style="color: #339933;">=</span> form<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="">'username'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>;
	<span style="color: #000088;">$password</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/md5"><span style="color: #990000;">md5</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="">'password'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Encrypts the password.</span>
	<span style="color: #000088;">$email</span> <span style="color: #339933;">=</span> form<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>;
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$username</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> || <span style="color: #009900;">&#40;</span><span style="color: #000088;">$password</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> || <span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// Checks for blanks.</span>
		<a href="http://www.php.net/exit"><span style="color: #990000;">exit</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;There was a field missing, please correct the form.&quot;</span><span style="color: #009900;">&#41;</span>;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000088;">$q</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT * FROM `users` WHERE username = '$username' OR email = '$email'&quot;</span><span style="color: #009900;">&#41;</span> or <a href="http://www.php.net/die"><span style="color: #990000;">die</span></a> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/mysql_error"><span style="color: #990000;">mysql_error</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// mySQL Query</span>
	<span style="color: #000088;">$r</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_num_rows"><span style="color: #990000;">mysql_num_rows</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$q</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Checks to see if anything is in the db.</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$r</span> <span style="color: #339933;">&gt;</span> <span style="color:#800080;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// If there are users with the same username/email.</span>
		<a href="http://www.php.net/exit"><span style="color: #990000;">exit</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;That username/email is already registered!&quot;</span><span style="color: #009900;">&#41;</span>;
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;INSERT INTO `users` (username,password,email) VALUES ('$username','$password','$email')&quot;</span><span style="color: #009900;">&#41;</span> or <a href="http://www.php.net/die"><span style="color: #990000;">die</span></a> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/mysql_error"><span style="color: #990000;">mysql_error</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Inserts the user.</span>
		<a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Location: login.php&quot;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Back to login.</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<a href="http://www.php.net/mysql_close"><span style="color: #990000;">mysql_close</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$db_connect</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Closes the connection.</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Breakdown:<br />
     We 1st include the database details and make sure the form has not been submitted. If it has not been submitted then we display the register form.<br />
     If the form is submitted, we make some variables so we can incorporate the form() function.<br />
     We then make sure that the users email or user name are not already in the database.<br />
     Then we insert the user into the database and redirect them to the login page.</p>
<p>The next page is login.php.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p6code22'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p622"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
</pre></td><td class="code" id="p6code22"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;conf.inc.php&quot;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Includes the db and form info.</span>
<a href="http://www.php.net/session_start"><span style="color: #990000;">session_start</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Starts the session.</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="">'logged'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// User is already logged in.</span>
	<a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Location: index.php&quot;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Goes to main page.</span>
	<a href="http://www.php.net/exit"><span style="color: #990000;">exit</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Stops the rest of the script.</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="">'submit'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// The form has not been submitted.</span>
		<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;form action=<span style="color: #000099; font-weight: bold;">\&quot;</span>login.php<span style="color: #000099; font-weight: bold;">\&quot;</span> method=<span style="color: #000099; font-weight: bold;">\&quot;</span>POST<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span>;
		<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;table&gt;&quot;</span>;
		<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;tr&gt;&quot;</span>;
		<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;td colspan=<span style="color: #000099; font-weight: bold;">\&quot;</span>2<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Login:&lt;/td&gt;&quot;</span>;
		<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;/tr&gt;&quot;</span>;
		<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;tr&gt;&quot;</span>;
		<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;td width=<span style="color: #000099; font-weight: bold;">\&quot;</span>50%<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Username:&lt;/td&gt;&lt;td width=<span style="color: #000099; font-weight: bold;">\&quot;</span>50%<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;input name=<span style="color: #000099; font-weight: bold;">\&quot;</span>username<span style="color: #000099; font-weight: bold;">\&quot;</span> size=<span style="color: #000099; font-weight: bold;">\&quot;</span>18<span style="color: #000099; font-weight: bold;">\&quot;</span> type=<span style="color: #000099; font-weight: bold;">\&quot;</span>text<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span>;
		<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;/tr&gt;&quot;</span>;
		<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;tr&gt;&quot;</span>;
		<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;td width=<span style="color: #000099; font-weight: bold;">\&quot;</span>50%<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Password:&lt;/td&gt;&lt;td width=<span style="color: #000099; font-weight: bold;">\&quot;</span>50%<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;input name=<span style="color: #000099; font-weight: bold;">\&quot;</span>password<span style="color: #000099; font-weight: bold;">\&quot;</span> size=<span style="color: #000099; font-weight: bold;">\&quot;</span>18<span style="color: #000099; font-weight: bold;">\&quot;</span> type=<span style="color: #000099; font-weight: bold;">\&quot;</span>text<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span>;
		<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;/tr&gt;&quot;</span>;
		<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;tr&gt;&quot;</span>;
		<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;td colspan=<span style="color: #000099; font-weight: bold;">\&quot;</span>2<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>submit<span style="color: #000099; font-weight: bold;">\&quot;</span> name=<span style="color: #000099; font-weight: bold;">\&quot;</span>submit<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>submit<span style="color: #000099; font-weight: bold;">\&quot;</span>&lt;/td&gt;&quot;</span>;
		<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;/tr&gt;&quot;</span>;
		<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;/table&gt;&quot;</span>;
		<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;/form&gt;&quot;</span>;
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$username</span> <span style="color: #339933;">=</span> form<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="">'username'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>;
		<span style="color: #000088;">$password</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/md5"><span style="color: #990000;">md5</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="">'password'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Encrypts the password.</span>
&nbsp;
		<span style="color: #000088;">$q</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT * FROM `users` WHERE username = '$username' AND password = '$password'&quot;</span><span style="color: #009900;">&#41;</span> or <a href="http://www.php.net/die"><span style="color: #990000;">die</span></a> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/mysql_error"><span style="color: #990000;">mysql_error</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// mySQL query</span>
		<span style="color: #000088;">$r</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_num_rows"><span style="color: #990000;">mysql_num_rows</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$q</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Checks to see if anything is in the db. </span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$r</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// There is something in the db. The username/password match up.</span>
			<span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="">'logged'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span>; <span style="color: #666666; font-style: italic;">// Sets the session.</span>
			<a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Location: index.php&quot;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Goes to main page.</span>
			<a href="http://www.php.net/exit"><span style="color: #990000;">exit</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Stops the rest of the script.</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// Invalid username/password.</span>
			<a href="http://www.php.net/exit"><span style="color: #990000;">exit</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Incorrect username/password!&quot;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Stops the script with an error message.</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<a href="http://www.php.net/mysql_close"><span style="color: #990000;">mysql_close</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$db_connect</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Closes the connection.</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Breakdown:<br />
     1st we include the db and function file, and start the session, telling the browser that sessions will be used.<br />
     We then make sure the form has not been submitted in order to show the login form.<br />
     If the form has been submitted we make 2 variables for user name and password. We encrypt the password with md5() so it is a bit more secure. (To all those who are experts in PHP, you would normally salt a password to make it harder to crack, but for beginners stick with md5())<br />
     We then have a query checking the database if any users match the use rname and password, and if there are matches it will be counted in $r.<br />
     If there are matches we set a login session.</p>
<p>Now we will make logout.php.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p6code23'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p623"><td width="1%" class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p6code23"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<a href="http://www.php.net/session_unset"><span style="color: #990000;">session_unset</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Destroys the session.</span>
<a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Location: login.php&quot;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Goes back to login.</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Breakdown:<br />
     We destroy all sessions and forward the user to the login page.</p>
<p>And last but not least, the page where you want only logged in users to view.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p6code24'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p624"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p6code24"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;conf.inc.php&quot;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Includes the db and form info.</span>
<a href="http://www.php.net/session_start"><span style="color: #990000;">session_start</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Starts the session.</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="">'logged'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// There was no session found!</span>
	<a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Location: login.php&quot;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Goes to login page.</span>
	<a href="http://www.php.net/exit"><span style="color: #990000;">exit</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// Stops the rest of the script.</span>
<span style="color: #009900;">&#125;</span>
<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;This is the main page!&quot;</span>;
<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span>;
<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;&lt;a href=<span style="color: #000099; font-weight: bold;">\&quot;</span>logout.php<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Logout?&lt;/a&gt;&quot;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Breakdown:<br />
     We include the config page.<br />
     Check to see if the logged in session is set, otherwise forward user to login page.<br />
     Allow the user to log out if needed.</p>
<p>Well thats the basic member system, I will add as people request more. If you have any questions please feel free to comment or contact me, I am more than happy to help!</p>
]]></content:encoded>
			<wfw:commentRss>http://gigaspartan.com/?feed=rss2&amp;p=6</wfw:commentRss>
		</item>
		<item>
		<title>Welcome</title>
		<link>http://gigaspartan.com/?p=4</link>
		<comments>http://gigaspartan.com/?p=4#comments</comments>
		<pubDate>Wed, 28 May 2008 20:18:08 +0000</pubDate>
		<dc:creator>Pat</dc:creator>
		
		<category><![CDATA[Posts]]></category>

		<guid isPermaLink="false">http://75.125.133.162/~giga/?p=4</guid>
		<description><![CDATA[Welcome to my blog, please bare with me as I add scripts and tutorials for you to enjoy.
]]></description>
			<content:encoded><![CDATA[<p>Welcome to my blog, please bare with me as I add scripts and tutorials for you to enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://gigaspartan.com/?feed=rss2&amp;p=4</wfw:commentRss>
		</item>
	</channel>
</rss>
