<?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: Creating a PHP CMS – Part 3</title>
	<atom:link href="http://fwebde.com/web-design/creating-a-php-cms-part-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://fwebde.com/web-design/creating-a-php-cms-part-3/</link>
	<description>Helping people to make fantastic websites, whether you are a designer, a developer, or someone just who loves websites.</description>
	<lastBuildDate>Fri, 15 Jul 2011 11:19:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: lizzie</title>
		<link>http://fwebde.com/web-design/creating-a-php-cms-part-3/comment-page-1/#comment-3819</link>
		<dc:creator>lizzie</dc:creator>
		<pubDate>Wed, 13 Apr 2011 12:35:02 +0000</pubDate>
		<guid isPermaLink="false">http://fwebde.com/?p=275#comment-3819</guid>
		<description>To clarify, it&#039;s a parse error, not an arse error :-S</description>
		<content:encoded><![CDATA[<p>To clarify, it's a parse error, not an arse error :-S</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lizzie</title>
		<link>http://fwebde.com/web-design/creating-a-php-cms-part-3/comment-page-1/#comment-3818</link>
		<dc:creator>lizzie</dc:creator>
		<pubDate>Tue, 12 Apr 2011 15:38:38 +0000</pubDate>
		<guid isPermaLink="false">http://fwebde.com/?p=275#comment-3818</guid>
		<description>Hii thanks for the wonderful tutorial. I&#039;m up to the end of this page and I&#039;m having trouble with functions.php, I get the following error

{arse error: syntax error, unexpected T_REQUIRE_ONCE on line 4

It&#039;s
require_once &#039;../functions.php&#039;;
on line 4.

Any suggestions?</description>
		<content:encoded><![CDATA[<p>Hii thanks for the wonderful tutorial. I'm up to the end of this page and I'm having trouble with functions.php, I get the following error</p>
<p>{arse error: syntax error, unexpected T_REQUIRE_ONCE on line 4</p>
<p>It's<br />
require_once '../functions.php';<br />
on line 4.</p>
<p>Any suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DavE</title>
		<link>http://fwebde.com/web-design/creating-a-php-cms-part-3/comment-page-1/#comment-3770</link>
		<dc:creator>DavE</dc:creator>
		<pubDate>Thu, 03 Mar 2011 15:30:03 +0000</pubDate>
		<guid isPermaLink="false">http://fwebde.com/?p=275#comment-3770</guid>
		<description>&lt;?php
include &#039;../functions.php&#039;
connect();

// Check if the title is entered
if ($_POST[&#039;title&#039;]) {
    $title = mysql_real_escape_string($_POST[&#039;title&#039;]);
} else {
    echo &#039;The title field is empty.&#039;;
}

// Check if the body is entered
if ($_POST[&#039;body&#039;]) {
    $body = mysql_real_escape_string($_POST[&#039;body&#039;]);
} else {
    echo &#039;The body field is empty.&#039;;
}

$date = time();

// If the title and body are both entered, insert into the database
if ($title &amp;&amp; $body) {
    connect();
 
    mysql_query(&quot;INSERT INTO pages (title, body, date) VALUES (&#039;$title&#039;, &#039;$body&#039;, &#039;$date&#039;)&quot;);
} else {
    echo &#039;&lt;a href=&quot;new.php&quot;&gt;Back&lt;/a&gt;&#039;;
}
?&gt;

what is wrong?</description>
		<content:encoded><![CDATA[<p>&lt;?php<br />
include &#039;../functions.php&#039;<br />
connect();</p>
<p>// Check if the title is entered<br />
if ($_POST[&#039;title&#039;]) {<br />
    $title = mysql_real_escape_string($_POST[&#039;title&#039;]);<br />
} else {<br />
    echo &#039;The title field is empty.';<br />
}</p>
<p>// Check if the body is entered<br />
if ($_POST['body']) {<br />
    $body = mysql_real_escape_string($_POST['body']);<br />
} else {<br />
    echo 'The body field is empty.';<br />
}</p>
<p>$date = time();</p>
<p>// If the title and body are both entered, insert into the database<br />
if ($title &amp;&amp; $body) {<br />
    connect();</p>
<p>    mysql_query("INSERT INTO pages (title, body, date) VALUES ('$title', '$body', '$date')");<br />
} else {<br />
    echo '<a href="new.php">Back</a>';<br />
}<br />
?&gt;</p>
<p>what is wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kars</title>
		<link>http://fwebde.com/web-design/creating-a-php-cms-part-3/comment-page-1/#comment-2065</link>
		<dc:creator>Kars</dc:creator>
		<pubDate>Sun, 26 Sep 2010 15:35:01 +0000</pubDate>
		<guid isPermaLink="false">http://fwebde.com/?p=275#comment-2065</guid>
		<description>Ah man all the time it was giving empty fields and i didn&#039;t know why! But i had deleted connect() at the start because i thought it wasn&#039;t needed since it was already called to later on with the insert query. I had to find out that mysql_real_escape_string does only work when there &#039;s a connection with the database &gt;.&lt;. Kinda logic, but it&#039;s nice to know. Moving on..;p</description>
		<content:encoded><![CDATA[<p>Ah man all the time it was giving empty fields and i didn't know why! But i had deleted connect() at the start because i thought it wasn't needed since it was already called to later on with the insert query. I had to find out that mysql_real_escape_string does only work when there 's a connection with the database &gt;.&lt;. Kinda logic, but it&#039;s nice to know. Moving on..;p</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Bannatyne</title>
		<link>http://fwebde.com/web-design/creating-a-php-cms-part-3/comment-page-1/#comment-2044</link>
		<dc:creator>Eric Bannatyne</dc:creator>
		<pubDate>Fri, 27 Aug 2010 17:43:17 +0000</pubDate>
		<guid isPermaLink="false">http://fwebde.com/?p=275#comment-2044</guid>
		<description>If you&#039;re getting errors with mysql_real_escape_string, that probably means that there is a problem with your connection to the MySQL database.

Remember: When inserting data into a database using these methods it is always &lt;strong&gt;crucial&lt;/strong&gt; to sanitize your inputs using mysql_real_escape_string, doing otherwise would be a huge security risk (See the SQL injection section of &lt;a href=&quot;http://fwebde.com/programming/hack-your-own-site/&quot;&gt;Hack Your Own Site&lt;/a&gt;. That article also mentions using prepared statements, a &quot;newer&quot; way of doing this, which is not mentioned in this article.</description>
		<content:encoded><![CDATA[<p>If you're getting errors with mysql_real_escape_string, that probably means that there is a problem with your connection to the MySQL database.</p>
<p>Remember: When inserting data into a database using these methods it is always <strong>crucial</strong> to sanitize your inputs using mysql_real_escape_string, doing otherwise would be a huge security risk (See the SQL injection section of <a href="http://fwebde.com/programming/hack-your-own-site/">Hack Your Own Site</a>. That article also mentions using prepared statements, a "newer" way of doing this, which is not mentioned in this article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cathy</title>
		<link>http://fwebde.com/web-design/creating-a-php-cms-part-3/comment-page-1/#comment-2043</link>
		<dc:creator>cathy</dc:creator>
		<pubDate>Fri, 27 Aug 2010 13:21:20 +0000</pubDate>
		<guid isPermaLink="false">http://fwebde.com/?p=275#comment-2043</guid>
		<description>I have tried this code, initially i got errors refering to &quot;mysql_real_escape_string&quot;

I decideed to remove this and just use &quot;$title = $_GET[&#039;title&#039;];&quot;.

I now hav enoerrors but the data is not saving, Am I doin fsomething wrong?</description>
		<content:encoded><![CDATA[<p>I have tried this code, initially i got errors refering to "mysql_real_escape_string"</p>
<p>I decideed to remove this and just use "$title = $_GET['title'];".</p>
<p>I now hav enoerrors but the data is not saving, Am I doin fsomething wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Bannatyne</title>
		<link>http://fwebde.com/web-design/creating-a-php-cms-part-3/comment-page-1/#comment-95</link>
		<dc:creator>Eric Bannatyne</dc:creator>
		<pubDate>Thu, 20 Aug 2009 03:07:25 +0000</pubDate>
		<guid isPermaLink="false">http://fwebde.com/?p=275#comment-95</guid>
		<description>Kabarovsky: This is probably not the case, but you can try making sure that the value of the &#039;name&#039; attributes in your form fields match your $_POST values.</description>
		<content:encoded><![CDATA[<p>Kabarovsky: This is probably not the case, but you can try making sure that the value of the 'name' attributes in your form fields match your $_POST values.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Bannatyne</title>
		<link>http://fwebde.com/web-design/creating-a-php-cms-part-3/comment-page-1/#comment-92</link>
		<dc:creator>Eric Bannatyne</dc:creator>
		<pubDate>Wed, 19 Aug 2009 01:52:24 +0000</pubDate>
		<guid isPermaLink="false">http://fwebde.com/?p=275#comment-92</guid>
		<description>The quotes are really mostly extra protection, just in case... :P</description>
		<content:encoded><![CDATA[<p>The quotes are really mostly extra protection, just in case... :P</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hua Chen</title>
		<link>http://fwebde.com/web-design/creating-a-php-cms-part-3/comment-page-1/#comment-91</link>
		<dc:creator>Hua Chen</dc:creator>
		<pubDate>Wed, 19 Aug 2009 01:37:31 +0000</pubDate>
		<guid isPermaLink="false">http://fwebde.com/?p=275#comment-91</guid>
		<description>I also afraid of SQL injection, but didn&#039;t mysql_real_escape_string has already prevent it? Can you help me Google it in Google English or ask your friends about it? Thanks!</description>
		<content:encoded><![CDATA[<p>I also afraid of SQL injection, but didn't mysql_real_escape_string has already prevent it? Can you help me Google it in Google English or ask your friends about it? Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Bannatyne</title>
		<link>http://fwebde.com/web-design/creating-a-php-cms-part-3/comment-page-1/#comment-90</link>
		<dc:creator>Eric Bannatyne</dc:creator>
		<pubDate>Tue, 18 Aug 2009 16:26:12 +0000</pubDate>
		<guid isPermaLink="false">http://fwebde.com/?p=275#comment-90</guid>
		<description>Hua Chen: There are some speed differences. I think that the quotes may also help to prevent SQL injection, but I&#039;m not completely sure.</description>
		<content:encoded><![CDATA[<p>Hua Chen: There are some speed differences. I think that the quotes may also help to prevent SQL injection, but I'm not completely sure.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

