<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Building Browsergames: The Registration Page (PHP)</title>
	<atom:link href="http://buildingbrowsergames.com/2008/04/17/building-browsergames-the-registration-page-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://buildingbrowsergames.com/2008/04/17/building-browsergames-the-registration-page-php/</link>
	<description>Ever wanted to build a browsergame?</description>
	<lastBuildDate>Wed, 30 Nov 2011 19:42:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Telugu Movie</title>
		<link>http://buildingbrowsergames.com/2008/04/17/building-browsergames-the-registration-page-php/comment-page-1/#comment-970</link>
		<dc:creator>Telugu Movie</dc:creator>
		<pubDate>Wed, 30 Nov 2011 19:42:01 +0000</pubDate>
		<guid isPermaLink="false">http://buildingbrowsergames.com/?p=7#comment-970</guid>
		<description>This  is my huge happiness to visit your site and to like your excellent post. Continue on posting and thanks for sharing this .</description>
		<content:encoded><![CDATA[<p>This  is my huge happiness to visit your site and to like your excellent post. Continue on posting and thanks for sharing this .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bangla movie </title>
		<link>http://buildingbrowsergames.com/2008/04/17/building-browsergames-the-registration-page-php/comment-page-1/#comment-969</link>
		<dc:creator>bangla movie </dc:creator>
		<pubDate>Mon, 21 Nov 2011 19:43:31 +0000</pubDate>
		<guid isPermaLink="false">http://buildingbrowsergames.com/?p=7#comment-969</guid>
		<description>Healthy and interesting, have a hard deciding what I really think of it all.&lt;br&gt;&lt;p&gt;&lt;a href=&quot;http://www.newbanglamovie.com/&quot; rel=&quot;nofollow&quot;&gt;bangla natok&lt;/a&gt;&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Healthy and interesting, have a hard deciding what I really think of it all.
<p><a href="http://www.newbanglamovie.com/" rel="nofollow">bangla natok</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rokas Rimkevicius</title>
		<link>http://buildingbrowsergames.com/2008/04/17/building-browsergames-the-registration-page-php/comment-page-1/#comment-796</link>
		<dc:creator>Rokas Rimkevicius</dc:creator>
		<pubDate>Sat, 14 May 2011 13:15:06 +0000</pubDate>
		<guid isPermaLink="false">http://buildingbrowsergames.com/?p=7#comment-796</guid>
		<description>You need to put your server information between $dbhost= &#039;HERE&#039; and all the other...</description>
		<content:encoded><![CDATA[<p>You need to put your server information between $dbhost= &#39;HERE&#39; and all the other&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Benjamin Vangeel</title>
		<link>http://buildingbrowsergames.com/2008/04/17/building-browsergames-the-registration-page-php/comment-page-1/#comment-795</link>
		<dc:creator>Benjamin Vangeel</dc:creator>
		<pubDate>Thu, 05 May 2011 21:03:17 +0000</pubDate>
		<guid isPermaLink="false">http://buildingbrowsergames.com/?p=7#comment-795</guid>
		<description>Hey - so I&#039;m trying to create the Query on the &#039;Users&#039; table (the 			$dbhost = &#039;localhost&#039;;&lt;br&gt;			$dbuser = &#039;user&#039;;&lt;br&gt;			$dbpass = &#039;pass&#039;;&lt;br&gt;			$dbname = &#039;name&#039;;	&lt;br&gt;		} one),&lt;br&gt;but I&#039;m getting an error: &#039;ERROR: Onbekende Punctuatie String @ 1&lt;br&gt;STR: SQL: 			$dbhost = &#039;localhost&#039;;			$dbhost = &#039;localhost&#039;;			$dbhost = &#039;localhost&#039;;			$dbhost = &#039;localhost&#039;;			$dbhost = &#039;localhost&#039;;			$dbhost = &#039;localhost&#039;;&lt;br&gt;&lt;br&gt;SQL-query:&lt;br&gt;&lt;br&gt;&lt;br&gt;MySQL retourneerde: &lt;br&gt;&lt;br&gt;#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;&lt;?php    } else {&lt;br&gt;            $dbhost = &#039;localhost&#039;&#039; at line 1 &#039;&lt;br&gt;&lt;br&gt;What could I have done wrong? Thanks in advance.</description>
		<content:encoded><![CDATA[<p>Hey &#8211; so I&#39;m trying to create the Query on the &#39;Users&#39; table (the 			$dbhost = &#39;localhost&#39;;<br />			$dbuser = &#39;user&#39;;<br />			$dbpass = &#39;pass&#39;;<br />			$dbname = &#39;name&#39;;	<br />		} one),<br />but I&#39;m getting an error: &#39;ERROR: Onbekende Punctuatie String @ 1<br />STR: SQL: 			$dbhost = &#39;localhost&#39;;			$dbhost = &#39;localhost&#39;;			$dbhost = &#39;localhost&#39;;			$dbhost = &#39;localhost&#39;;			$dbhost = &#39;localhost&#39;;			$dbhost = &#39;localhost&#39;;</p>
<p>SQL-query:</p>
<p>MySQL retourneerde: </p>
<p>#1064 &#8211; You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#39;&lt;?php    } else {<br />            $dbhost = &#39;localhost&#39;&#39; at line 1 &#39;</p>
<p>What could I have done wrong? Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kismet</title>
		<link>http://buildingbrowsergames.com/2008/04/17/building-browsergames-the-registration-page-php/comment-page-1/#comment-703</link>
		<dc:creator>Kismet</dc:creator>
		<pubDate>Tue, 26 Jan 2010 11:19:44 +0000</pubDate>
		<guid isPermaLink="false">http://buildingbrowsergames.com/?p=7#comment-703</guid>
		<description>Perfect Marius! It works! Thankyou so much for this.&lt;br&gt;&lt;br&gt;I am baffled though, why didn&#039;t the original code &#039;work out of the box&#039;? Is it something wrong with Wamp? Should I be using something else to do these tutorials with?&lt;br&gt;&lt;br&gt;Thanks again.</description>
		<content:encoded><![CDATA[<p>Perfect Marius! It works! Thankyou so much for this.</p>
<p>I am baffled though, why didn&#39;t the original code &#39;work out of the box&#39;? Is it something wrong with Wamp? Should I be using something else to do these tutorials with?</p>
<p>Thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marius</title>
		<link>http://buildingbrowsergames.com/2008/04/17/building-browsergames-the-registration-page-php/comment-page-1/#comment-702</link>
		<dc:creator>Marius</dc:creator>
		<pubDate>Tue, 26 Jan 2010 00:28:05 +0000</pubDate>
		<guid isPermaLink="false">http://buildingbrowsergames.com/?p=7#comment-702</guid>
		<description>Yeah, delete the following two lines: &lt;br&gt;&lt;br&gt;list($count) = mysql_fetch_row($result);&lt;br&gt;if($count &gt;= 1) { ?&gt;&lt;br&gt;&lt;br&gt;Move the following line: &lt;br&gt;&lt;br&gt;&lt;span style=&#039;color:red&#039;&gt;Error: that username is taken.&lt;/span&gt;&lt;br&gt;&lt;br&gt;to go inside my if block: &lt;br&gt;&lt;br&gt;if($result) { ?&gt;&lt;br&gt;&lt;span style=&#039;color:red&#039;&gt;Error: that username is taken.&lt;/span&gt;&lt;br&gt;&lt;?php } &lt;br&gt;&lt;br&gt;Notice that you now have two &quot;else&quot; blocks, delete the one closest to the if, the one which have no code inside the {  }:&lt;br&gt;&lt;br&gt;else {&lt;br&gt;}&lt;br&gt;&lt;br&gt;-----------------&lt;br&gt;The code should then look like this:&lt;br&gt;.....&lt;br&gt;$query = sprintf(&quot;SELECT * FROM users WHERE username = &#039;%s&#039;&quot;,&lt;br&gt;mysql_real_escape_string($_POST[&#039;username&#039;]));&lt;br&gt;$result = mysql_query($query);&lt;br&gt;if($result) { ?&gt;&lt;br&gt;&lt;span style=&#039;color:red&#039;&gt;Error: that username is taken.&lt;/span&gt;&lt;br&gt;&lt;?php } else {&lt;br&gt;$query = sprintf(&quot;INSERT INTO users(username,password) VALUES (&#039;%s&#039;,&#039;%s&#039;);&quot;,&lt;br&gt;mysql_real_escape_string($_POST[&#039;username&#039;]),&lt;br&gt;mysql_real_escape_string(md5($password)));&lt;br&gt;mysql_query($query);&lt;br&gt;?&gt;&lt;br&gt;&lt;span style=&#039;color:green&#039;&gt;Congratulations, you registered successfully!&lt;/span&gt;&lt;br&gt;&lt;?php&lt;br&gt;}&lt;br&gt;}&lt;br&gt;}&lt;br&gt;?&gt;</description>
		<content:encoded><![CDATA[<p>Yeah, delete the following two lines: </p>
<p>list($count) = mysql_fetch_row($result);<br />if($count &gt;= 1) { ?&gt;</p>
<p>Move the following line: </p>
<p>&lt;span style=&#39;color:red&#39;&gt;Error: that username is taken.&lt;/span&gt;</p>
<p>to go inside my if block: </p>
<p>if($result) { ?&gt;<br />&lt;span style=&#39;color:red&#39;&gt;Error: that username is taken.&lt;/span&gt;<br />&lt;?php } </p>
<p>Notice that you now have two &#8220;else&#8221; blocks, delete the one closest to the if, the one which have no code inside the {  }:</p>
<p>else {<br />}</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />The code should then look like this:<br />&#8230;..<br />$query = sprintf(&#8221;SELECT * FROM users WHERE username = &#39;%s&#39;&#8221;,<br />mysql_real_escape_string($_POST[&#39;username&#39;]));<br />$result = mysql_query($query);<br />if($result) { ?&gt;<br />&lt;span style=&#39;color:red&#39;&gt;Error: that username is taken.&lt;/span&gt;<br />&lt;?php } else {<br />$query = sprintf(&#8221;INSERT INTO users(username,password) VALUES (&#39;%s&#39;,&#39;%s&#39;);&#8221;,<br />mysql_real_escape_string($_POST[&#39;username&#39;]),<br />mysql_real_escape_string(md5($password)));<br />mysql_query($query);<br />?&gt;<br />&lt;span style=&#39;color:green&#39;&gt;Congratulations, you registered successfully!&lt;/span&gt;<br />&lt;?php<br />}<br />}<br />}<br />?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kismet</title>
		<link>http://buildingbrowsergames.com/2008/04/17/building-browsergames-the-registration-page-php/comment-page-1/#comment-701</link>
		<dc:creator>Kismet</dc:creator>
		<pubDate>Mon, 25 Jan 2010 21:44:02 +0000</pubDate>
		<guid isPermaLink="false">http://buildingbrowsergames.com/?p=7#comment-701</guid>
		<description>Thankyou so much Marius. I&#039;ve tried to implement your new code as best I can. And this is what my register.php looks like now:&lt;br&gt;&lt;br&gt;--------------------------------&lt;br&gt;&lt;?php&lt;br&gt;	if($_POST) {&lt;br&gt;		$password = $_POST[&#039;password&#039;];&lt;br&gt;		$confirm = $_POST[&#039;confirm&#039;];	&lt;br&gt;		if($password != $confirm) { ?&gt;&lt;br&gt;&lt;span style=&#039;color:red&#039;&gt;Error: Passwords do not match!&lt;/span&gt;&lt;br&gt;&lt;?php	} else {&lt;br&gt;			$dbhost = &#039;localhost&#039;;&lt;br&gt;			$dbuser = &#039;root&#039;;&lt;br&gt;			$dbpass = &#039;&#039;;&lt;br&gt;			$dbname = &#039;BBG&#039;;&lt;br&gt;			require_once &#039;config.php&#039;;&lt;br&gt;			$conn = mysql_connect($dbhost,$dbuser,$dbpass)&lt;br&gt;				or die (&#039;Error connecting to mysql&#039;);&lt;br&gt;			mysql_select_db($dbname);&lt;br&gt;			$query = sprintf(&quot;SELECT * FROM users WHERE username = &#039;%s&#039;&quot;, &lt;br&gt;                        mysql_real_escape_string($_POST[&#039;username&#039;]));&lt;br&gt;			$result = mysql_query($query);&lt;br&gt;                        if($result) {&lt;br&gt;                          } else {&lt;br&gt;                            }&lt;br&gt;			list($count) = mysql_fetch_row($result);&lt;br&gt;			if($count &gt;= 1) { ?&gt;&lt;br&gt;&lt;span style=&#039;color:red&#039;&gt;Error: that username is taken.&lt;/span&gt;&lt;br&gt;&lt;?php		} else {&lt;br&gt;				$query = sprintf(&quot;INSERT INTO users(username,password) VALUES (&#039;%s&#039;,&#039;%s&#039;);&quot;,&lt;br&gt;					mysql_real_escape_string($_POST[&#039;username&#039;]),&lt;br&gt;					mysql_real_escape_string(md5($password)));&lt;br&gt;				mysql_query($query);&lt;br&gt;			?&gt;&lt;br&gt;&lt;span style=&#039;color:green&#039;&gt;Congratulations, you registered successfully!&lt;/span&gt;&lt;br&gt;&lt;?php&lt;br&gt;			}	&lt;br&gt;		}&lt;br&gt;	}&lt;br&gt;?&gt;&lt;br&gt;&lt;form method=&#039;post&#039; action=&#039;register.php&#039;&gt;Username: &lt;input type=&#039;text&#039; name=&#039;username&#039; /&gt;&lt;br /&gt;&lt;br&gt;Password: &lt;input type=&#039;password&#039; name=&#039;password&#039; /&gt;&lt;br /&gt;&lt;br&gt;Confirm Password: &lt;input type=&#039;password&#039; name=&#039;confirm&#039; /&gt;&lt;br /&gt;&lt;br&gt;&lt;input type=&#039;submit&#039; value=&#039;Register!&#039; /&gt;&lt;br&gt;&lt;/form&gt;&lt;br&gt;------------------------------&lt;br&gt;&lt;br&gt;The error message has changed, now it says &#039;Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in C:wampwwwBBGregister.php on line 22&#039;.&lt;br&gt;&lt;br&gt;Line 22 is this one: list($count) = mysql_fetch_row($result);&lt;br&gt;&lt;br&gt;I know I&#039;ve done something wrong, but I feel I&#039;m very close to getting this working. Can you see where I&#039;ve messed up?</description>
		<content:encoded><![CDATA[<p>Thankyou so much Marius. I&#39;ve tried to implement your new code as best I can. And this is what my register.php looks like now:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />&lt;?php<br />	if($_POST) {<br />		$password = $_POST[&#39;password&#39;];<br />		$confirm = $_POST[&#39;confirm&#39;];	<br />		if($password != $confirm) { ?&gt;<br />&lt;span style=&#39;color:red&#39;&gt;Error: Passwords do not match!&lt;/span&gt;<br />&lt;?php	} else {<br />			$dbhost = &#39;localhost&#39;;<br />			$dbuser = &#39;root&#39;;<br />			$dbpass = &#39;&#39;;<br />			$dbname = &#39;BBG&#39;;<br />			require_once &#39;config.php&#39;;<br />			$conn = mysql_connect($dbhost,$dbuser,$dbpass)<br />				or die (&#39;Error connecting to mysql&#39;);<br />			mysql_select_db($dbname);<br />			$query = sprintf(&#8221;SELECT * FROM users WHERE username = &#39;%s&#39;&#8221;, <br />                        mysql_real_escape_string($_POST[&#39;username&#39;]));<br />			$result = mysql_query($query);<br />                        if($result) {<br />                          } else {<br />                            }<br />			list($count) = mysql_fetch_row($result);<br />			if($count &gt;= 1) { ?&gt;<br />&lt;span style=&#39;color:red&#39;&gt;Error: that username is taken.&lt;/span&gt;<br />&lt;?php		} else {<br />				$query = sprintf(&#8221;INSERT INTO users(username,password) VALUES (&#39;%s&#39;,&#39;%s&#39;);&#8221;,<br />					mysql_real_escape_string($_POST[&#39;username&#39;]),<br />					mysql_real_escape_string(md5($password)));<br />				mysql_query($query);<br />			?&gt;<br />&lt;span style=&#39;color:green&#39;&gt;Congratulations, you registered successfully!&lt;/span&gt;<br />&lt;?php<br />			}	<br />		}<br />	}<br />?&gt;<br />&lt;form method=&#39;post&#39; action=&#39;register.php&#39;&gt;Username: &lt;input type=&#39;text&#39; name=&#39;username&#39; /&gt;</p>
<p>Password: &lt;input type=&#39;password&#39; name=&#39;password&#39; /&gt;</p>
<p>Confirm Password: &lt;input type=&#39;password&#39; name=&#39;confirm&#39; /&gt;</p>
<p>&lt;input type=&#39;submit&#39; value=&#39;Register!&#39; /&gt;<br />&lt;/form&gt;<br />&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>The error message has changed, now it says &#39;Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in C:wampwwwBBGregister.php on line 22&#39;.</p>
<p>Line 22 is this one: list($count) = mysql_fetch_row($result);</p>
<p>I know I&#39;ve done something wrong, but I feel I&#39;m very close to getting this working. Can you see where I&#39;ve messed up?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marius</title>
		<link>http://buildingbrowsergames.com/2008/04/17/building-browsergames-the-registration-page-php/comment-page-1/#comment-700</link>
		<dc:creator>Marius</dc:creator>
		<pubDate>Mon, 25 Jan 2010 13:46:11 +0000</pubDate>
		<guid isPermaLink="false">http://buildingbrowsergames.com/?p=7#comment-700</guid>
		<description>Yeah, I dropped the &quot;count&quot; approach and did this instead:&lt;br&gt;&lt;br&gt;$query = sprintf(&quot;SELECT * FROM users WHERE username = &#039;%s&#039;&quot;, mysql_real_escape_string($_POST[&#039;username&#039;])));&lt;br&gt;$result = mysql_fetch_array(mysql_query($isuser));&lt;br&gt;&lt;br&gt;Then I use a simple if statement to check if I got any data or not:&lt;br&gt;if($result) {&lt;br&gt;// User already exists&lt;br&gt;} else {&lt;br&gt;// User does not exist, safe to register if all input validates&lt;br&gt;}&lt;br&gt;&lt;br&gt;$result is an array, and if the user exists in the DB I have data there and the if check returns true, if no data enters the array is empty and the if check returns false and runs the else statement instead.</description>
		<content:encoded><![CDATA[<p>Yeah, I dropped the &#8220;count&#8221; approach and did this instead:</p>
<p>$query = sprintf(&#8221;SELECT * FROM users WHERE username = &#39;%s&#39;&#8221;, mysql_real_escape_string($_POST[&#39;username&#39;])));<br />$result = mysql_fetch_array(mysql_query($isuser));</p>
<p>Then I use a simple if statement to check if I got any data or not:<br />if($result) {<br />// User already exists<br />} else {<br />// User does not exist, safe to register if all input validates<br />}</p>
<p>$result is an array, and if the user exists in the DB I have data there and the if check returns true, if no data enters the array is empty and the if check returns false and runs the else statement instead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luke</title>
		<link>http://buildingbrowsergames.com/2008/04/17/building-browsergames-the-registration-page-php/comment-page-1/#comment-699</link>
		<dc:creator>Luke</dc:creator>
		<pubDate>Mon, 25 Jan 2010 12:32:19 +0000</pubDate>
		<guid isPermaLink="false">http://buildingbrowsergames.com/?p=7#comment-699</guid>
		<description>I couldn&#039;t say what&#039;s breaking for you, and you&#039;ll want to look at the&lt;br&gt;line just before the one where the error&#039;s being thrown - somehow,&lt;br&gt;your $result variable is being set to a boolean value instead of a&lt;br&gt;mysql resource.</description>
		<content:encoded><![CDATA[<p>I couldn&#39;t say what&#39;s breaking for you, and you&#39;ll want to look at the<br />line just before the one where the error&#39;s being thrown &#8211; somehow,<br />your $result variable is being set to a boolean value instead of a<br />mysql resource.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kismet</title>
		<link>http://buildingbrowsergames.com/2008/04/17/building-browsergames-the-registration-page-php/comment-page-1/#comment-698</link>
		<dc:creator>Kismet</dc:creator>
		<pubDate>Mon, 25 Jan 2010 10:23:10 +0000</pubDate>
		<guid isPermaLink="false">http://buildingbrowsergames.com/?p=7#comment-698</guid>
		<description>Duh! I&#039;m so dumb! You&#039;re right Luke, I needed to change the configuration file to match my Wamp info:&lt;br&gt;&lt;br&gt;&lt;?php&lt;br&gt;$dbhost = &#039;localhost&#039;;&lt;br&gt;$dbuser = &#039;root&#039;;&lt;br&gt;$dbpass = &#039;&#039;;&lt;br&gt;$dbname = &#039;db_name&#039;;&lt;br&gt;?&gt;&lt;br&gt;&lt;br&gt;Now it&#039;s working, but I&#039;m getting a new error: &lt;br&gt;&lt;br&gt;Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in C:wampwwwBBGregister.php on line 19&lt;br&gt;&lt;br&gt;This is line 19: list($count) = mysql_fetch_row($result);&lt;br&gt;&lt;br&gt;I see that Marius had the same problem and managed to solve it, but he didn&#039;t post his solution :(. &lt;br&gt;&lt;br&gt;Anybody have any ideas?</description>
		<content:encoded><![CDATA[<p>Duh! I&#39;m so dumb! You&#39;re right Luke, I needed to change the configuration file to match my Wamp info:</p>
<p>&lt;?php<br />$dbhost = &#39;localhost&#39;;<br />$dbuser = &#39;root&#39;;<br />$dbpass = &#39;&#39;;<br />$dbname = &#39;db_name&#39;;<br />?&gt;</p>
<p>Now it&#39;s working, but I&#39;m getting a new error: </p>
<p>Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in C:wampwwwBBGregister.php on line 19</p>
<p>This is line 19: list($count) = mysql_fetch_row($result);</p>
<p>I see that Marius had the same problem and managed to solve it, but he didn&#39;t post his solution <img src='http://buildingbrowsergames.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> . </p>
<p>Anybody have any ideas?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

