<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dot Com Infoway - Latest Technology, Web Development and SEO Blog, News, Updates and Tips &#187; Web Development</title>
	<atom:link href="http://www.dotcominfoway.com/blog/author/web-development/feed" rel="self" type="application/rss+xml" />
	<link>http://www.dotcominfoway.com/blog</link>
	<description>Dot Com Infoway- Blog</description>
	<lastBuildDate>Mon, 06 Feb 2012 13:01:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Oauth and its uses</title>
		<link>http://www.dotcominfoway.com/blog/oauth-and-its-uses</link>
		<comments>http://www.dotcominfoway.com/blog/oauth-and-its-uses#comments</comments>
		<pubDate>Wed, 07 Jul 2010 14:14:05 +0000</pubDate>
		<dc:creator>Web Development</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Oauth]]></category>

		<guid isPermaLink="false">http://www.dotcominfoway.com/blog/?p=2869</guid>
		<description><![CDATA[Open Authentication means an authentication system which will allow users to share their private resources in a site without using their user name and password. The requests are received from all types of devices to a remote application or web service for processing of information. Nowadays requests are not only from standard computers but also [...]]]></description>
			<content:encoded><![CDATA[<p>Open Authentication means an authentication system which will allow users to share their private resources in a site without using their user name and password. The requests are received from all types of devices to a remote application or web service for processing of information.</p>
<p>Nowadays requests are not only from standard computers but also from many types of mobile devices like smart cards, mobile phones, laptops etc. So, using Open Authentication can make these devices  strong authentication devices.</p>
<p><strong>What is the need for Oauth?</strong></p>
<p>If it is possible to implement an authentication protocol for less than $10 then it will reduce the possibility of credit card fraud, it can reduce the cost of merchants, card associations and finally consumers.<br />
<span id="more-2869"></span><br />
It will increase user privacy by providing unique credentials without reentering the name or security number etc. Open Authentication means authenticate system which will allow users to share their private resources without sharing the user name/password/account details.</p>
<p><strong>Vision for Oauth</strong></p>
<p>The vision of Oauth concentrates on three important areas. They are</p>
<p>Credential and Security Devices &#8211; (SIM based, Public Key and OTP).<br />
Authentication protocol framework<br />
Credential provisioning and validation</p>
<p>The primary aim is to provide an all-in-one-security device, which can embed many basic authentication methods (for example authentication, encryption, signing, secure storage and physical access)</p>
<p>In the above mentioned methods, OTP is used in web applications for communication remote web services. For example Google Accounts, Facebook, Twitter, LinkedIn  social networks can be accessed through Oauth.</p>
<p>In future Oauth maybe the only option for remote application access instead of conventional API methods. It is more advantageous than the API method of contacting the remote application. In API methods, different applications will follow different standards and authentication procedures and the password or access id will last only for a limited period. But in Oauth, there is a single standard for all types for report application access and one time registering and life long access id and secret key. Now most of the open applications and social networks give provision for Oauth.</p>
<img src="http://www.dotcominfoway.com/blog/?ak_action=api_record_view&id=2869&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.dotcominfoway.com/blog/oauth-and-its-uses/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento: The Complete E-commerce Solution</title>
		<link>http://www.dotcominfoway.com/blog/magento-the-complete-e-commerce-solution</link>
		<comments>http://www.dotcominfoway.com/blog/magento-the-complete-e-commerce-solution#comments</comments>
		<pubDate>Wed, 30 Jun 2010 07:22:00 +0000</pubDate>
		<dc:creator>Web Development</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.dotcominfoway.com/blog/?p=2846</guid>
		<description><![CDATA[Magento is an Open Source Software which is specially made for E-commerce websites. It is very easy to install and maintain a Magento website as Magento CMS has an effective admin panel at the back-end. Magento – Overview: Multiple website concept is the soul feature of Magento. Multiple websites can be controlled from one administrative [...]]]></description>
			<content:encoded><![CDATA[<p>Magento is an Open Source Software which is specially made for E-commerce websites. It is very easy to install and maintain a Magento website as Magento CMS has an effective admin panel at the back-end.</p>
<p><strong>Magento – Overview:</strong> Multiple website concept is the soul feature of Magento. Multiple websites can be controlled from one administrative panel using a single database.  It allows store owners to maintain stores on different URLs and display the same products in all the URLs or site specific products.</p>
<p>Magento provides the option to let customers compare products in order to buy the most suitable one. Design can be easily integrated in Magento, which is developed using Zend framework for code effectiveness.<span id="more-2846"></span></p>
<p>There are many Open Source extensions available for Magento. Each extension needs a key to be installed. We can extend the system by using Magento connect through the admin panel.</p>
<p><strong>How to create multiple websites using Magento</strong></p>
<p>To create multiple websites and stores, we need to create a website, a store and store view for each website using system configuration. Each website should have the unique code and enabled store views will be displayed in websites. We can set the base URL for each store for viewing it in different sub domains.<br />
<strong>Magento Features</strong></p>
<ul>
<li>Can control multiple websites/stores from one administrator panel</li>
<li>Content Management System provided for static pages such as About Us, FAQ etc</li>
<li>Multiple Currency Support</li>
<li>Multi-lingual Support</li>
<li>Newsletter Management</li>
<li>Batch Import/Export of product updates</li>
<li>SSL security support</li>
<li>Customer Support and Order Inventory system</li>
<li>SEO Friendly URLs are inbuilt in Magento</li>
<li>Web services API with any third party integration</li>
<li>In-built iPhone customized theme available</li>
<li>Ability to assign the design for Category/Product level</li>
</ul>
<img src="http://www.dotcominfoway.com/blog/?ak_action=api_record_view&id=2846&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.dotcominfoway.com/blog/magento-the-complete-e-commerce-solution/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Zikula &#8211; Its easy all the way!</title>
		<link>http://www.dotcominfoway.com/blog/zikula-its-easy-all-the-way</link>
		<comments>http://www.dotcominfoway.com/blog/zikula-its-easy-all-the-way#comments</comments>
		<pubDate>Tue, 01 Jun 2010 14:41:49 +0000</pubDate>
		<dc:creator>Web Development</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[Zikula advantage]]></category>
		<category><![CDATA[Zikula CMS]]></category>
		<category><![CDATA[zikula features]]></category>

		<guid isPermaLink="false">http://www.dotcominfoway.com/blog/?p=2643</guid>
		<description><![CDATA[Zikula is an Open Source, PHP-based Application Framework. It allows developers to create feature-rich, interactive websites which can be maintained through a comprehensive and easy-to-use administrator panel that requires little to no HTML knowledge. The administrator interface is browser based and is therefore easily accessible and simple to use. Zikula and PostNuke: Originally,  Zikula was [...]]]></description>
			<content:encoded><![CDATA[<p>Zikula is an Open Source, PHP-based Application Framework. It allows developers to create feature-rich, interactive websites which can be maintained through a comprehensive and easy-to-use administrator panel that requires little to no HTML knowledge. The administrator interface is browser based and is therefore easily accessible and simple to use.</p>
<p><strong>Zikula and PostNuke: </strong>Originally,  Zikula was known by the name &#8211; PostNuke. Version 8 of PostNuke was released as Zikula Version 1 in July 2008.  The latest stable release in Zikula is Zikula V 1.2.3 – this was released on April 20, 2010.</p>
<p style="text-align: left;"><strong>Zikula &#8211; Features:</strong> Zikula can be used to develop just about any kind of website, right from a standalone weblog to a  multi-featured website like an e-commerce site.  <span id="more-2643"></span><a href="http://www.dotcominfoway.com/blog/wp-content/uploads/2010/06/1242053561.png"><img class="size-full wp-image-2644  aligncenter" title="1242053561" src="http://www.dotcominfoway.com/blog/wp-content/uploads/2010/06/1242053561.png" alt="" width="198" height="150" /></a>A salient feature of the Zikula framework is its clear-cut distinction between content and design, which cuts down the development time for a website, thereby making it a cost-effective solution that delivers a quality product (website) for a low price.</p>
<p>The design (look/feel) of the website can be controlled through Zikula&#8217;s simple and elegant theme system, which allows the site-administrator to control and maintain the design by modifying only the relevant HTML code. The PHP code need not be touched/modified at all!</p>
<p>Additional functionalities and features can be easily added to any Zikula-based website. These features are readily available as extensions and plugins which can be downloaded and integrated into the website seamlessly. The plug-and-play nature of these extensions allows administrators to easily enable / disable the features in the website and thus give them control over how they wish their website to work.</p>
<p><strong>Highlights of Zikula:</strong></p>
<ul>
<li>Ease of Installation &amp; Set up</li>
<li>Comprehensive administrator panel</li>
<li>Quick and easy development of websites</li>
<li>Good Security &amp; Performance</li>
<li>Flexibility and Scalability of use</li>
<li>Easy to use Template Management System</li>
<li>Availability of Open Source Modules &amp; Plugins in Zikula Community</li>
<li>A helpful User Community</li>
</ul>
<img src="http://www.dotcominfoway.com/blog/?ak_action=api_record_view&id=2643&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.dotcominfoway.com/blog/zikula-its-easy-all-the-way/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Security Tips</title>
		<link>http://www.dotcominfoway.com/blog/php-security-tips</link>
		<comments>http://www.dotcominfoway.com/blog/php-security-tips#comments</comments>
		<pubDate>Wed, 26 May 2010 06:43:53 +0000</pubDate>
		<dc:creator>Web Development</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[PHP Security Tips]]></category>
		<category><![CDATA[Security Tips]]></category>

		<guid isPermaLink="false">http://www.dotcominfoway.com/blog/?p=2605</guid>
		<description><![CDATA[Search Google on the topic “php security”, you will come across a great article in Security Tips. We would like to share the valuable tips inspired from that article. This post discusses about the most common security vulnerabilities along with some standard best practices in php coding. PHP is the most popular web programming languages [...]]]></description>
			<content:encoded><![CDATA[<p>Search Google on the topic “php security”, you will come across a great article in <a href="http://www.noupe.com/php/php-security-tips.html" target="_blank">Security Tips</a>. We would like to share the valuable tips inspired from that article. This post discusses about the most common security vulnerabilities along with some standard best practices in php coding.</p>
<p>PHP is the most popular web programming languages in use today due in large part to the fact that it is a highly flexible syntax that can perform many functions while working flawlessly in conjunction with HTML. It is relatively easy to learn for beginners and is also powerful enough for advanced users. It works exceptionally well with open source tools, such as the Apache web server and MySQL database. In other words, its versatility is unsurpassed when compared to other scripting languages, making it the language of choice for many programmers.<span id="more-2605"></span></p>
<p>There are various types of attacks that PHP is particularly vulnerable to. The two main types of attacks are human attacks and automated attacks, both of which can potentially devastate a website. The goal of PHP security is to minimize, and ultimately eliminate, the potential for both human and automated attacks by putting into place strategic lines of defense to eliminate access to your site by unverified users. The way you go about doing this is to target the most common types of PHP security breaches first, so that you can guard your website against malicious attacks. So what are the most common types of PHP security breaches?</p>
<p><strong><br />
Most Common PHP Security Vulnerabilities</strong><br />
<strong><br />
1. Register_Globals</strong></p>
<p>Register_Globals makes writing PHP applications simple and convenient for the developer, but it also poses a potential security risk. This setting is located in PHP’s configuration file, which is php.ini, and it can be either turned on or off. When turned on, it allows unverified users to inject variables into an application to gain administrative access to your website. Most, if not all, PHP security experts recommend turning register_globals off.</p>
<p>So instead of relying on register_globals, you should instead go through PHP Predefined Variables, such as $_REQUEST. To further tighten security, you should also specify by using: $_ENV, $_GET, $_POST, $_COOKIE, or $_SERVER instead of using the more general $_REQUEST.</p>
<p><strong>2. Error Reporting</strong></p>
<p>Error reporting is a great tool for diagnosing bugs. It allows you to fix bugs quicker and easier, but also poses a potential security threat. The problem occurs when the error is visible to others on-screen, because it reveals possible security holes in your source code that a hacker can easily take advantage of. If display_errors is not turned off, or has a value of “0?, the output will appear on the end user’s browser – Not good for security! If you want to set log_errors to on, then indicate the exact location of the log with error_log.</p>
<p><strong>3. Cross-site Scripting (XSS)</strong></p>
<p>Cross-site scripting, or XSS, is a way for hackers to gather your website’s user data by using malicious markup or JavaScript code to trick a user, or their browser, to follow a bad link or present their login details to a fake login screen, which, instead of logging them in, steals their personal information. The best way to defend against XSS is to disable JavaScript and images while surfing the web, but we all know that’s nearly impossible with so many websites using JavaScript’s rich application environment these days.</p>
<p>Useful for protecting against XSS is a useful PHP function called htmlentities(). This simple function works by converting all characters in html to their corresponding entities, such as “&lt;” would convert to “&lt;” (without the quotes).</p>
<p><strong>4. Remote File Inclusion (RFI)</strong></p>
<p>This type of attack is relatively unknown amongst developers, which makes it an especially damaging threat to PHP security. Remote file inclusion, or RFI, involves an attack from a remote location that exploits a vulnerable PHP application and injects malicious code for the purpose of spamming or even gaining access to the root folder of the server. An unverified user gaining access to any server can wreak major havoc on a website in many different ways, including abusing personal information stored in databases.</p>
<p>The best way to secure your site from RFI attacks is through php.ini directives – Specifically, the allow_url_fopen and the allow_url_include directives. The allow_url_fopen directive is set to on by default, and the allow_url_include is set to off. These two simple directives will adequately protect your site from RFI attacks.</p>
<p><strong>Other PHP Security Tools</strong></p>
<p>- <a href="http://phpsec.org/projects/phpsecinfo/index.html" target="_blank">PhpSecInfo</a></p>
<p>This useful tool reports security information in the PHP environment, and best of all, it offers suggestions for improving the errors. It is available for download under the “New BSD” license, and the PhpSecInfo project is always looking for more PHP developers to help improve this tool.</p>
<p>- <a href="http://sourceforge.net/projects/securityscanner/" target="_blank">PHP Security Scanner</a></p>
<p>This is a tool used to scan PHP code for vulnerabilities, and it can be used to scan any directory. PHP Security Scanner features an useful UI for better visualization of potential problems, and it supports basic wild card search functionality for filtering directories or files that are to be searched.</p>
<p>- <a href="http://developer.spikesource.com/projects/phpsecaudit/" target="_blank">Spike PHP Security Audit Tool</a></p>
<p>The Spike PHP Security Audit Tool is an open source solution for doing static analysis of PHP code. It will search for security exploits, so you can correct them during the development process.</p>
<p>Here, we have given some basic coding standard for setting up database configuration. This is very simple one without implementation of any framework. We have given it to explain how can we convert a normal code to a standard code.</p>
<p>$mysql = mysql_connect(&#8216;localhost&#8217;, &#8216;test&#8217;, &#8216;test&#8217;);<br />
mysql_select_db(&#8216;sample&#8217;) or die(&#8220;cannot select DB&#8221;);</p>
<p>Trying a DRY approach</p>
<p>$db_host = &#8216;localhost&#8217;;<br />
$db_user = &#8216;test&#8217;;<br />
$db_password = &#8216;test&#8217;;<br />
$db_database = &#8216;bwired&#8217;;</p>
<p>$mysql = mysql_connect($db_host, $db_user, $db_password);<br />
mysql_select_db($db_database);</p>
<p>As the values normally don’t change, we can use constants</p>
<p>define(&#8216;DB_HOST&#8217;, &#8216;localhost&#8217;);<br />
define(&#8216;DB_USER&#8217;, &#8216;test&#8217;);<br />
define(&#8216;DB_PASSWORD&#8217;, &#8216;test&#8217;);<br />
define(&#8216;DB_DATABASE&#8217;, &#8216;sample&#8217;);</p>
<p>$mysql = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);<br />
mysql_select_db(DB_DATABASE);</p>
<p>After years of changing the values every time, you upload something to the live server</p>
<p>define(&#8216;LIVE_ENV&#8217;, true);</p>
<p>if(LIVE_ENV) {<br />
define(&#8216;DB_HOST&#8217;, &#8216;localhost&#8217;);<br />
define(&#8216;DB_USER&#8217;, &#8216;test&#8217;);<br />
define(&#8216;DB_PASSWORD&#8217;, &#8216;test&#8217;);<br />
define(&#8216;DB_DATABASE&#8217;, &#8216;bwired&#8217;);<br />
} else {<br />
define(&#8216;DB_HOST&#8217;, &#8216;testserver.com&#8217;);<br />
define(&#8216;DB_USER&#8217;, &#8216;testuser&#8217;);<br />
define(&#8216;DB_PASSWORD&#8217;, &#8216;test&#8217;);<br />
define(&#8216;DB_DATABASE&#8217;, &#8216;sample&#8217;);<br />
}</p>
<p>$mysql = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);<br />
mysql_select_db(DB_DATABASE);</p>
<p>Even better would be this</p>
<p>if ($_SERVER["HTTP_HOST"] == &#8216;www.domain.com&#8217;)  // remote live environment<br />
{ &#8230; }<br />
else // localhost test environment<br />
{ &#8230; }</p>
<p>PHP5 procedural approach using the new mysql extension</p>
<p>$link = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE);<br />
if (!$link) {<br />
printf(&#8220;Connect failed: %s\n&#8221;, mysqli_connect_error());<br />
exit();<br />
}</p>
<p>printf(&#8220;Host information: %s\n&#8221;, mysqli_get_host_info($link));<br />
mysqli_close($link);</p>
<img src="http://www.dotcominfoway.com/blog/?ak_action=api_record_view&id=2605&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.dotcominfoway.com/blog/php-security-tips/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Joomla For Dummies Even Mummies Won&#8217;t Forget</title>
		<link>http://www.dotcominfoway.com/blog/joomla-for-dummies-even-mummies-wont-forget</link>
		<comments>http://www.dotcominfoway.com/blog/joomla-for-dummies-even-mummies-wont-forget#comments</comments>
		<pubDate>Thu, 12 Nov 2009 12:50:09 +0000</pubDate>
		<dc:creator>Web Development</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[content management systems]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[joomla basics]]></category>
		<category><![CDATA[joomla cms]]></category>
		<category><![CDATA[joomla features]]></category>
		<category><![CDATA[joomla for mummies]]></category>
		<category><![CDATA[joomla for starters]]></category>

		<guid isPermaLink="false">http://www.dotcominfoway.com/blog/?p=1404</guid>
		<description><![CDATA[With a large sector of websites being developed using Content Management Systems, it is of utmost importance for website owners and developers to choose the right CMS for their needs. The wide range of Content Management Systems available today, however, make it a daunting prospect to choose the right CMS. Some factors to take into [...]]]></description>
			<content:encoded><![CDATA[<p>With a large sector of websites being developed using <a href="http://www.dotcominfoway.com/web-development/cms/">Content Management Systems</a>, it is of utmost importance for website owners and developers to choose the right CMS for their needs. The wide range of Content Management Systems available today, however, make it a daunting prospect to choose the right CMS.</p>
<p>Some factors to take into account while choosing a CMS are :</p>
<ul>
<li>Simple Installation</li>
<li>User friendly and comprehensive admin panel</li>
<li>Availability of plugins and modules for extended functionality</li>
<li>Simple template manipulation</li>
<li>Helpful user community</li>
</ul>
<p><strong>Why Joomla? </strong>Joomla is designed in such a way that it can be set up easily even by a novice user. All credits to its  simple and quick  installation process, Joomla is the best recommended CMS for anyone who wants to build a site in just a few minutes. This CMS offers a large number of extensions that are available to users from the Joomla Extension Directory, considered to be the true power of Joomla.<span id="more-1404"></span></p>
<p><strong>Joomla is game for anything: </strong>Joomla is one most flexible CMS that can be used by users around the globe to build websites of all shapes and sizes. Whether it be an <a href="http://www.dotcominfoway.com/web-development/ecommerce-solutions">eCommerce website</a>, or a community website, a government application website, a community-based portal, or a corporate website or a normal personal website , Joomla  is game for anything. The CMS is a powerhouse of capabilities that can help users in any kind of website building. Its powerful features have earned it tremendous recognition from users.</p>
<p><strong>Joomla features even mummies would love: </strong>Joomla provides many features such as User Management, Content Management, Banner Management, Template Management, Web link Management, Newsfeed Management, Polls, Search, Web services and a lot more.</p>
<p>The latest version of Joomla 1.5 supports Template Over-riding, where one can control and change the look and layout of the output of Joomla Modules and Extensions without disturbing the core Joomla code. This feature gives website designers a certain level of control over the layout and the design of the website.</p>
<img src="http://www.dotcominfoway.com/blog/?ak_action=api_record_view&id=1404&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.dotcominfoway.com/blog/joomla-for-dummies-even-mummies-wont-forget/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to achieve safe updates with MySQL in PHP</title>
		<link>http://www.dotcominfoway.com/blog/how-to-achieve-safe-updates-with-mysql-in-php</link>
		<comments>http://www.dotcominfoway.com/blog/how-to-achieve-safe-updates-with-mysql-in-php#comments</comments>
		<pubDate>Tue, 22 Sep 2009 13:49:09 +0000</pubDate>
		<dc:creator>Web Development</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.dotcominfoway.com/blog/?p=1144</guid>
		<description><![CDATA[How to achieve safe updates with MySQL and PHP In this post, we are going to discuss about safety updates with MySQL and using that with PHP. For beginners, a useful startup option is &#8216;safe updates&#8217; (or &#8211;i-am-a-dummy, which has the same effect). This option was introduced in MySQL 3.23.11. It is helpful during situations [...]]]></description>
			<content:encoded><![CDATA[<p>How to achieve safe updates with MySQL and PHP</p>
<p>In this post, we are going to discuss about safety updates with MySQL and using that with PHP.</p>
<p>For beginners, a useful startup option is &#8216;safe updates&#8217; (or &#8211;i-am-a-dummy, which has the same effect). </p>
<p>This option was introduced in MySQL 3.23.11. It is helpful during situations wherein you might have issued a “DELETE FROM tbl_name” statement but forgotten the WHERE clause. Normally, such a statement deletes all rows from the table. With &#8216;safe updates&#8217;, you can delete rows only by specifying the key values that identify them. Hence, this helps prevent accidental deletions. <span id="more-1144"></span></p>
<p>When you use the &#8216;safe updates&#8217; option, MySQL issues the following statement when it connects to the MySQL server: </p>
<p>SET sql_safe_updates=1, sql_select_limit=1000, sql_max_join_size=1000000;</p>
<p>The SET statement has the following effects:</p>
<p>You are not allowed to execute an UPDATE or DELETE a statement unless you specify a key constraint in the WHERE clause or provide a LIMIT clause (or both). For example:</p>
<p>UPDATE tbl_name SET not_key_column=val WHERE key_column=val;</p>
<p>UPDATE tbl_name SET not_key_column=val LIMIT 1</p>
<p>The server limits all large SELECT results to 1,000 rows unless the statement includes a LIMIT clause. </p>
<p>These are the options available with MySQL. </p>
<p>Now, we can use this in our coding by doing a small trick.</p>
<p>When you use the &#8216;safe updates&#8217;  option and connect MySQL at command prompt, MySQL issues the following statement when it connects to the MySQL server: </p>
<p>SET sql_safe_updates=1, sql_select_limit=1000, sql_max_join_size=1000000;&#8217; </p>
<p>So, we can use this &#8220;SET sql_safe_updates=1&#8243; query in our PHP coding. After connecting with the server and selecting the db, we need to execute this query so that safety update will affect all the other queries executed thereafter. This will ensure that no updates or delete operations perform without the WHERE clause.</p>
<p>This is an useful and important safety measure which can be used in our projects to avoid accidental deletion of all records in a table. </p>
<p>&lt;?<br />
// This is will be useful to avoid sql injection which may delete all rows of a table</p>
<p>// http://dev.mysql.com/doc/refman/4.1/en/mysql-tips.html</p>
<p>error_reporting(E_ALL);</p>
<p>$con= mysql_connect(&#8220;localhost&#8221;,&#8221;sorna&#8221;,&#8221;password&#8221;);<br />
mysql_select_db(&#8220;test1&#8243;,$con);<br />
mysql_query(&#8220;SET sql_safe_updates=1&#8243;);</p>
<p>mysql_query(&#8220;DELETE FROM register&#8221;); // This line won&#8217;t delete the table since we have turned on the safe updates mode. It won&#8217;t execute the delete query when it doesn&#8217;t have where clause<br />
mysql_query(&#8220;DELETE FROM register WHERE id=6&#8243;); // This line will delete the record in which id is 6<br />
mysql_close();</p>
<p>?&gt;</p>
<img src="http://www.dotcominfoway.com/blog/?ak_action=api_record_view&id=1144&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.dotcominfoway.com/blog/how-to-achieve-safe-updates-with-mysql-in-php/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Whitelist Form for SPAM Protection: Part II</title>
		<link>http://www.dotcominfoway.com/blog/whitelist-form-for-spam-protection-part-ii</link>
		<comments>http://www.dotcominfoway.com/blog/whitelist-form-for-spam-protection-part-ii#comments</comments>
		<pubDate>Fri, 04 Sep 2009 14:21:28 +0000</pubDate>
		<dc:creator>Web Development</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[SPAM protection]]></category>
		<category><![CDATA[whitelist]]></category>

		<guid isPermaLink="false">http://www.dotcominfoway.com/blog/?p=998</guid>
		<description><![CDATA[This post is a continuation of our previous post Whitelist Form for SPAM Protection: Part I Here, we have explained the session part mentioned in the code. Please refer to code samples before moving to the explanation. Cross-site scripting (XSS) allows code injection of harmful web users in the web pages used by other users. [...]]]></description>
			<content:encoded><![CDATA[<p>This post is a continuation of our previous post<br />
<a title="Whitelist Form for SPAM protection: Part I" href="http://www.dotcominfoway.com/blog/whitelist-form-for-spam-protection">Whitelist Form for SPAM Protection: Part I</a><br />
<br />
Here, we have explained the session part mentioned in the code.</p>
<p>Please refer to <a title="Whitelist Form for SPAM protection" href="http://www.dotcominfoway.com/blog/whitelist-form-for-spam-protection">code samples</a> before moving to the explanation.</p>
<p>Cross-site scripting (<a title="XSS" href="http://en.wikipedia.org/wiki/Cross-site_scripting" target="_blank">XSS</a>) allows code injection of harmful web users in the web pages used by other users. Attackers can do it by using client-side scripts which help them to exploit browser details.</p>
<p>Attackers mainly use this method to hack a site when users browse/enter sensitive data like username, password, bank account number etc. Everything seems fine to the end-user while entering crucial data, but they maybe subject to unauthorized access i.e. they might become a victim of hacking, whereby all their important data are given away to the hackers. This leads to financial and   critical data loss.</p>
<p><span id="more-998"></span></p>
<p>Here is a solution called Session which can circumvent such hacking problems. Session code is set on the server-side. We can generate a random session key by using md5 for encryption so that the session code is never repeated and stands unique. This code is set as a hidden value in the page which is being browsed by the user. Session codes are never the same. They keep changing with the browser.</p>
<p>This session code can be submitted through URL or as a hidden field. As shown in the code, we check for the session code generated and submitted from the key session. If the person trying to hack the site tries to manipulate user data and submit it, the session code will be different or there will not be any session code. From this, we can check for user intrusion/hacking and stop such hackers from proceeding further.</p>
<p>Using session not only prevents intrusion, but also theft of crucial data by attackers/hackers. Above all, it ensures complete security to end-users.</p>
<img src="http://www.dotcominfoway.com/blog/?ak_action=api_record_view&id=998&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.dotcominfoway.com/blog/whitelist-form-for-spam-protection-part-ii/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Whitelist Form for SPAM protection: Part I</title>
		<link>http://www.dotcominfoway.com/blog/whitelist-form-for-spam-protection</link>
		<comments>http://www.dotcominfoway.com/blog/whitelist-form-for-spam-protection#comments</comments>
		<pubDate>Fri, 28 Aug 2009 06:25:45 +0000</pubDate>
		<dc:creator>Web Development</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[SPAM protection]]></category>
		<category><![CDATA[web forms]]></category>
		<category><![CDATA[whitelist]]></category>

		<guid isPermaLink="false">http://www.dotcominfoway.com/blog/?p=889</guid>
		<description><![CDATA[Developing a highly secure SPAM protection shield in your site is not an easy, hands down job. Here is an Whitelist which can check if the details posted by a user in your forms are valid and authentic. Why this Whitelist? This is for security purposes and prevents site hacking and intrusion. This is used [...]]]></description>
			<content:encoded><![CDATA[<p>Developing a highly secure SPAM protection shield in your site is not an easy, hands down job. Here is an Whitelist which can check if the details posted by a user in your forms are valid and authentic.
</p>
<p><strong>Why this Whitelist?</strong></p>
<ul>
<li>This is for security purposes and prevents site hacking and intrusion.</li>
<li>This is used instead of Captcha where the user sometimes feels difficult to enter the Captcha code.</li>
<li>Hidden fields are given in the form along with the required details fields.</li>
<li>If any extra request comes from the form (user), there is an error saying that the site is being hacked.</li>
<li>This way a site can be protected from SPAM and  hacking. The security key, session key etc used here also helps against site hacking.</li>
</ul>
<p><span id="more-889"></span><br />
Below is an example code on how to achieve this:</p>
<p><strong>Example Code</strong></p>
<p>if(isset($_REQUEST['btn_submit'])){<br />
if(isset($_SESSION['secure_key'])) //check the session form key<br />
{<br />
if($_SESSION['secure_key']==$_POST['form_key']) //check the form key<br />
{<br />
$white_list = array(&#8216;tbx_field1&#8242;,&#8217;tbx_field2&#8242;,&#8217;tbx_field3&#8242;,&#8217;tbx_field4&#8242;); // List of submitting form possible fields.<br />
foreach($_POST as $key=&gt;$item){<br />
//Check if the values posted by the form is in par with the white list array, if not error msg to hacker<br />
if(!in_array($key, $white_list)){<br />
$error_log = &#8220;You are trying to hack the site&#8221;;<br />
}<br />
}<br />
}else{<br />
$error_log=&#8221;Invalid form key&#8221;;<br />
}<br />
}else{<br />
$error_log=&#8221;Session has expired&#8221;;<br />
}<br />
}<br />
}</p>
<img src="http://www.dotcominfoway.com/blog/?ak_action=api_record_view&id=889&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.dotcominfoway.com/blog/whitelist-form-for-spam-protection/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

