<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>IT staffing resourcing &#124; Software Development &#124; Offshore Software Development</title>
	<atom:link href="http://codeplatter123.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://codeplatter123.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Wed, 16 Sep 2009 06:29:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='codeplatter123.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>IT staffing resourcing &#124; Software Development &#124; Offshore Software Development</title>
		<link>http://codeplatter123.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://codeplatter123.wordpress.com/osd.xml" title="IT staffing resourcing &#124; Software Development &#124; Offshore Software Development" />
	<atom:link rel='hub' href='http://codeplatter123.wordpress.com/?pushpress=hub'/>
		<item>
		<title>How to become a good Software Test Engineer?</title>
		<link>http://codeplatter123.wordpress.com/2009/09/16/how-to-become-a-good-software-test-engineer-2/</link>
		<comments>http://codeplatter123.wordpress.com/2009/09/16/how-to-become-a-good-software-test-engineer-2/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 06:29:37 +0000</pubDate>
		<dc:creator>codeplatter123</dc:creator>
				<category><![CDATA[Software Testing]]></category>

		<guid isPermaLink="false">http://codeplatter123.wordpress.com/?p=39</guid>
		<description><![CDATA[Source  – http://dev.codeplatter.com Official Website – http://www.codeplatter.com/ How to become a good Software Test Engineer? A good Software Test Engineer has a &#8216;test to break&#8217; attitude, an ability to take the point of view of the customer, a strong desire for quality, and an attention to detail. Tact and diplomacy are useful in maintaining a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeplatter123.wordpress.com&amp;blog=8811015&amp;post=39&amp;subd=codeplatter123&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Source  – <a title="http://dev.codeplatter.com" href="http://dev.codeplatter.com/" target="_blank">http://dev.codeplatter.com<br />
</a>Official Website – <a title="http://www.codeplatter.com/" href="http://www.codeplatter.com/" target="_blank">http://www.codeplatter.com/</a></p>
<p>How to become a good Software Test Engineer?</p>
<p>A good Software Test Engineer has a &#8216;test to break&#8217; attitude, an ability to take the point of view of the customer, a strong desire for quality, and an attention to detail. Tact and diplomacy are useful in maintaining a cooperative relationship with Developers, and an ability to communicate with both Technical (Developers) and Non-technical (Customers, Management) people is useful. Previous software development experience can be helpful as it provides a deeper understanding of the Software Development process, gives the Tester an appreciation for the Developers&#8217; point of view, and reduce the learning curve in Automated Test Tool programming. Judgement skills are needed to assess high-risk or critical areas of an application on which to focus testing efforts when time is limited.</p>
<p>Reference Website for testing &#8211; <a title="http://www.qacampus.com" href="http://www.qacampus.com" target="_blank">http://www.qacampus.com</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeplatter123.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeplatter123.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeplatter123.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeplatter123.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codeplatter123.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codeplatter123.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codeplatter123.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codeplatter123.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeplatter123.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeplatter123.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeplatter123.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeplatter123.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeplatter123.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeplatter123.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeplatter123.wordpress.com&amp;blog=8811015&amp;post=39&amp;subd=codeplatter123&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codeplatter123.wordpress.com/2009/09/16/how-to-become-a-good-software-test-engineer-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a3029aa84cc06043d699d3a88ee8c44c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">codeplatter123</media:title>
		</media:content>
	</item>
		<item>
		<title>How to become a good Software Test Engineer?</title>
		<link>http://codeplatter123.wordpress.com/2009/09/03/how-to-become-a-good-software-test-engineer/</link>
		<comments>http://codeplatter123.wordpress.com/2009/09/03/how-to-become-a-good-software-test-engineer/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 07:29:46 +0000</pubDate>
		<dc:creator>codeplatter123</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://codeplatter123.wordpress.com/2009/09/03/how-to-become-a-good-software-test-engineer/</guid>
		<description><![CDATA[Source  – http://dev.codeplatter.com Official Website – http://www.codeplatter.com/ How to become a good Software Test Engineer? A good Software Test Engineer has a &#8216;test to break&#8217; attitude, an ability to take the point of view of the customer, a strong desire for quality, and an attention to detail. Tact and diplomacy are useful in maintaining a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeplatter123.wordpress.com&amp;blog=8811015&amp;post=38&amp;subd=codeplatter123&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Source  – <a title="http://dev.codeplatter.com" href="http://dev.codeplatter.com/" target="_blank">http://dev.codeplatter.com<br />
</a>Official Website – <a title="http://www.codeplatter.com/" href="http://www.codeplatter.com/" target="_blank">http://www.codeplatter.com/</a></p>
<p>How to become a good Software Test Engineer?</p>
<p>A good Software Test Engineer has a &#8216;test to break&#8217; attitude, an ability to take the point of view of the customer, a strong desire for quality, and an attention to detail. Tact and diplomacy are useful in maintaining a cooperative relationship with Developers, and an ability to communicate with both Technical (Developers) and Non-technical (Customers, Management) people is useful. Previous software development experience can be helpful as it provides a deeper understanding of the Software Development process, gives the Tester an appreciation for the Developers&#8217; point of view, and reduce the learning curve in Automated Test Tool programming. Judgement skills are needed to assess high-risk or critical areas of an application on which to focus testing efforts when time is limited.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeplatter123.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeplatter123.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeplatter123.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeplatter123.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codeplatter123.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codeplatter123.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codeplatter123.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codeplatter123.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeplatter123.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeplatter123.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeplatter123.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeplatter123.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeplatter123.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeplatter123.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeplatter123.wordpress.com&amp;blog=8811015&amp;post=38&amp;subd=codeplatter123&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codeplatter123.wordpress.com/2009/09/03/how-to-become-a-good-software-test-engineer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a3029aa84cc06043d699d3a88ee8c44c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">codeplatter123</media:title>
		</media:content>
	</item>
		<item>
		<title>Important Website for .Net Developers</title>
		<link>http://codeplatter123.wordpress.com/2009/09/02/important-website-for-net-developers/</link>
		<comments>http://codeplatter123.wordpress.com/2009/09/02/important-website-for-net-developers/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 10:40:05 +0000</pubDate>
		<dc:creator>codeplatter123</dc:creator>
				<category><![CDATA[1]]></category>
		<category><![CDATA[.net dovelepment]]></category>

		<guid isPermaLink="false">http://codeplatter123.wordpress.com/?p=36</guid>
		<description><![CDATA[Source  – http://dev.codeplatter.com Official Website – http://www.codeplatter.com/ Here is the list of important website for .Net Developers/Programmers. 1). Microsoft Official Website, http://www.microsoft.com 2). ASP.NET Official Website, http://www.asp.net 3). Visual Studio Developer Center, http://msdn.microsoft.com 4). Scott Guthrie&#8217;s Blog,he build few products for Microsoft, http://weblogs.asp.net/scottgu 5). 4GuysFromRolla.com, http://www.aspnet.4guysfromrolla.com 6). .NET Programming &#8211; .Net Online Tutorial for Web [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeplatter123.wordpress.com&amp;blog=8811015&amp;post=36&amp;subd=codeplatter123&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Source  – <a title="http://dev.codeplatter.com" href="http://dev.codeplatter.com/" target="_blank">http://dev.codeplatter.com<br />
</a>Official Website – <a title="http://www.codeplatter.com/" href="http://www.codeplatter.com/" target="_blank">http://www.codeplatter.com/</a></p>
<p>Here is the list of important website for .Net Developers/Programmers.<br />
1). Microsoft Official Website, <!-- m --><a href="http://www.microsoft.com/">http://www.microsoft.com</a><!-- m --><br />
2). ASP.NET Official Website, <!-- m --><a href="http://www.asp.net/">http://www.asp.net</a><!-- m --><br />
3). Visual Studio Developer Center, <!-- m --><a href="http://msdn.microsoft.com/">http://msdn.microsoft.com</a><!-- m --><br />
4). Scott Guthrie&#8217;s Blog,he build few products for Microsoft, <!-- m --><a href="http://weblogs.asp.net/scottgu">http://weblogs.asp.net/scottgu</a><!-- m --><br />
5). 4GuysFromRolla.com, <!-- m --><a href="http://www.aspnet.4guysfromrolla.com/">http://www.aspnet.4guysfromrolla.com</a><!-- m --><br />
6). .NET Programming &#8211; .Net Online Tutorial for Web Developer&#8217;s, <!-- m --><a href="http://dotnet-guide.com/">http://dotnet-guide.com</a><!-- m --><br />
7). Tutorials, news, sample code, user contributed code and web services directory. <!-- m --><a href="http://www.dotnetjunkies.com/">http://www.dotnetjunkies.com</a><!-- m --><br />
8). <!-- m --><a href="http://aspalliance.com/">http://aspalliance.com</a></p>
<p>Here below is the Source code websites. which can help u.<br />
Some times the developers requires instant codes and they don&#8217;t have the time to write code, so the given list can help that programmers very well.<br />
1). <!-- m --><a href="http://www.planet-source-code.com/">http://www.planet-source-code.com</a><!-- m -->, alot of codes including Visual Basic, ASP, PHP, Javascript etc.<br />
2). <!-- m --><a href="http://www.codeproject.com/">http://www.codeproject.com</a><!-- m -->, Huge list of articles tutorials,codes etc<br />
3). <!-- m --><a href="http://www.a1vbcode.com/">http://www.a1vbcode.com</a><!-- m -->, as the name says A1<br />
4). <!-- m --><a href="http://www.codebeach.com/">http://www.codebeach.com</a><!-- m -->, List of codes, articles<br />
5). <!-- m --><a href="http://www.codetoad.com/">http://www.codetoad.com</a><!-- m -->, same as above<br />
6). <!-- m --><a href="http://www.aspalliance.com/">http://www.aspalliance.com</a><!-- m -->. Gud site<br />
7). <!-- m --><a href="http://www.123aspx.com/">http://www.123aspx.com</a><!-- m -->, mainly concentrate on ASP products i.e. ASP and ASP.net<br />
8). <!-- m --><a href="http://www.aspfree.com/">http://www.aspfree.com/</a><!-- m -->, excellent website<br />
9). <!-- m --><a href="http://www.c-sharpcorner.com/">http://www.c-sharpcorner.com</a><!-- m -->, Codes,Tutorials in C Sharp<br />
10). <!-- m --><a href="http://www.programmersresource.com/">http://www.programmersresource.com</a><!-- m -->, All type of programming resources<br />
11). <!-- m --><a href="http://www.worldofasp.net/">http://www.worldofasp.net/</a><!-- m --> Welcome to ASP.Net World!!!! Ya<br />
12). <!-- m --><a href="http://www.programmersheaven.com/">http://www.programmersheaven.com</a><!-- m -->, Source Codes Heaven/Jannat<br />
13). <!-- m --><a href="http://www.codeguru.com/">http://www.codeguru.com</a><!-- m -->, free source codes etc.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeplatter123.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeplatter123.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeplatter123.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeplatter123.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codeplatter123.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codeplatter123.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codeplatter123.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codeplatter123.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeplatter123.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeplatter123.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeplatter123.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeplatter123.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeplatter123.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeplatter123.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeplatter123.wordpress.com&amp;blog=8811015&amp;post=36&amp;subd=codeplatter123&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codeplatter123.wordpress.com/2009/09/02/important-website-for-net-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a3029aa84cc06043d699d3a88ee8c44c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">codeplatter123</media:title>
		</media:content>
	</item>
		<item>
		<title>Filling dropdowns with ajax and java script without refresh</title>
		<link>http://codeplatter123.wordpress.com/2009/08/22/filling-dropdowns-with-ajax-and-java-script-without-refresh/</link>
		<comments>http://codeplatter123.wordpress.com/2009/08/22/filling-dropdowns-with-ajax-and-java-script-without-refresh/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 05:38:47 +0000</pubDate>
		<dc:creator>codeplatter123</dc:creator>
				<category><![CDATA[1]]></category>
		<category><![CDATA[.net dovelepment]]></category>

		<guid isPermaLink="false">http://codeplatter123.wordpress.com/?p=34</guid>
		<description><![CDATA[Source  – http://dev.codeplatter.com Official Website – http://www.codeplatter.com/ Filling dropdowns with ajax and java script without refreshment create one .js file in your web project ,and write-down following code in file . function company(PartyC,companyC,CompanyN,PartyC1) { var statecode = new Array(); statecode = PartyC.split(&#8216;??&#8217;); var Dcode = new Array(); Dcode = companyC.split(&#8216;??&#8217;); var DName = new Array(); [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeplatter123.wordpress.com&amp;blog=8811015&amp;post=34&amp;subd=codeplatter123&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Source  – <a title="http://dev.codeplatter.com" href="http://dev.codeplatter.com/" target="_blank">http://dev.codeplatter.com<br />
</a>Official Website – <a title="http://www.codeplatter.com/" href="http://www.codeplatter.com/" target="_blank">http://www.codeplatter.com/</a></p>
<p><span style="color:#ff0000;"><span style="font-weight:bold;">Filling dropdowns with  ajax and java script without refreshment</span></span><br />
create one .js file in your web project ,and write-down following code in file .<br />
function company(PartyC,companyC,CompanyN,PartyC1)<br />
{<br />
var statecode = new Array();<br />
statecode = PartyC.split(&#8216;??&#8217;);<br />
var Dcode = new Array();<br />
Dcode = companyC.split(&#8216;??&#8217;);<br />
var DName = new Array();<br />
DName = CompanyN.split(&#8216;??&#8217;);<br />
var statecode1 = new Array();<br />
statecode1 = PartyC1.split(&#8216;??&#8217;);</p>
<p>var i;<br />
var ch = document.forms['form1']['CmbPartyName'].value;<br />
if(ch!=0)<br />
{<br />
document.forms['form1']['CmBCompanyName'].length =0 ;<br />
var opt = document.createElement(&#8216;option&#8217;);<br />
document.getElementById(&#8216;CmBCompanyName&#8217;).options.add(opt);<br />
opt.text = &#8216;Select Company Name&#8217;;<br />
opt.value = &#8217;1&#8242; ;<br />
for (i = 1; i &lt; statecode1.length; i++)<br />
{<br />
if(statecode1[i] == ch )<br />
{<br />
var opt = document.createElement(&#8216;option&#8217;);<br />
document.getElementById(&#8216;CmBCompanyName&#8217;).options.add(opt);</p>
<p>opt.text = DName[i] ;<br />
opt.value = Dcode[i] ;<br />
}<br />
}</p>
<p>}<br />
}</p>
<p>And in ur aspx file use following code …<br />
Str = &#8220;select distinct P.PartyName, P.PartyCode &#8221; &amp; _<br />
&#8221; from PartyMaster P,CompanyMaster C WHERE P.PartyCode = C.PartyCode &#8221; &amp;_</p>
<p>Dim DTP As New Data.DataTable<br />
Dim DataAP As New SqlDataAdapter(Str, Con)<br />
DataAP.Fill(DTP)<br />
CmbPartyName.DataSource = DTP<br />
CmbPartyName.DataValueField = &#8220;PartyCode&#8221;<br />
CmbPartyName.DataTextField = &#8220;PartyName&#8221;<br />
CmbPartyName.DataBind()</p>
<p>Dim Drow As Data.DataRow<br />
For Each Drow In DTP.Rows<br />
PartyC = PartyC &amp; &#8220;??&#8221; &amp; Drow(&#8220;PartyCode&#8221;)<br />
Next<br />
Str = &#8221; Select C.CompanyCode, C.CompanyName &#8221; &amp; _<br />
&#8221; from CompanyMaster C &#8220;&amp; _</p>
<p>Dim DT1 As New Data.DataTable<br />
Dim DataA1 As New SqlDataAdapter(Str, Con)<br />
DataA1.Fill(DT1)<br />
CmBCompanyName.DataSource = DT1<br />
For Each Drow In DT1.Rows<br />
PartyC1 = PartyC1 &amp; &#8220;??&#8221; &amp; Drow(&#8220;PartyCode&#8221;)<br />
companyC = companyC &amp; &#8220;??&#8221; &amp; Drow(&#8220;CompanyCode&#8221;)<br />
CompanyN = CompanyN &amp; &#8220;??&#8221; &amp; Drow(&#8220;CompanyName&#8221;)<br />
AllowSaleOnForm = AllowSaleOnForm &amp; &#8220;??&#8221; &amp; Drow(&#8220;AllowSaleOnForm&#8221;)<br />
DespatchTypeName = DespatchTypeName &amp; &#8220;??&#8221; &amp; Drow(&#8220;DespatchTypeName&#8221;)<br />
Next<br />
CmbPartyName.Attributes.Add(&#8220;onchange&#8221;, &#8220;company( &#8216;&#8221; &amp; PartyC &amp; &#8220;&#8216;, &#8216;&#8221; &amp; companyC &amp; &#8220;&#8216;,&#8217;&#8221; &amp; CompanyN &amp; &#8220;&#8216;, &#8216;&#8221; &amp; PartyC1 &amp; &#8220;&#8216;)&#8221;)<br />
CmBCompanyName.Attributes.Add(&#8220;onchange&#8221;, &#8220;companychange( &#8216;&#8221; &amp; CmBCompanyName.SelectedValue &amp; &#8220;&#8216;, &#8216;&#8221; &amp; companyC &amp; &#8220;&#8216;,&#8217;&#8221; &amp; CompanyN &amp; &#8220;&#8216;, &#8216;&#8221; &amp; PartyC1 &amp; &#8220;&#8216;)&#8221;)<br />
<span style="color:#0000ff;"><br />
<span style="font-weight:bold;"><br />
try this code its very powerful for filling dropdowns ……..<br />
</span></span><br />
<span style="color:#ff0000;"><span style="font-weight:bold;"><br />
<img title="Question" src="http://dev.codeplatter.com/images/smilies/icon_question.gif" alt=":?:" /> <img title="Question" src="http://dev.codeplatter.com/images/smilies/icon_question.gif" alt=":?:" /><br />
This is not a complete code ,i miss important couple of lines in this code ,if anybody wants to use this code in project i will give him/her remaning lines &#8230;&#8230;&#8230;. </span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeplatter123.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeplatter123.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeplatter123.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeplatter123.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codeplatter123.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codeplatter123.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codeplatter123.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codeplatter123.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeplatter123.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeplatter123.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeplatter123.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeplatter123.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeplatter123.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeplatter123.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeplatter123.wordpress.com&amp;blog=8811015&amp;post=34&amp;subd=codeplatter123&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codeplatter123.wordpress.com/2009/08/22/filling-dropdowns-with-ajax-and-java-script-without-refresh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a3029aa84cc06043d699d3a88ee8c44c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">codeplatter123</media:title>
		</media:content>

		<media:content url="http://dev.codeplatter.com/images/smilies/icon_question.gif" medium="image">
			<media:title type="html">Question</media:title>
		</media:content>

		<media:content url="http://dev.codeplatter.com/images/smilies/icon_question.gif" medium="image">
			<media:title type="html">Question</media:title>
		</media:content>
	</item>
		<item>
		<title>Php Script Find Browser Width And Height</title>
		<link>http://codeplatter123.wordpress.com/2009/08/17/php-script-find-browser-width-and-height/</link>
		<comments>http://codeplatter123.wordpress.com/2009/08/17/php-script-find-browser-width-and-height/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 06:03:49 +0000</pubDate>
		<dc:creator>codeplatter123</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://codeplatter123.wordpress.com/2009/08/17/php-script-find-browser-width-and-height/</guid>
		<description><![CDATA[Source  – http://dev.codeplatter.com Official Website – http://www.codeplatter.com/ Below is the PHP code to retrieve the Width and Height of Browser window using PHP. ========== Code Starts ============= &#60;?php session_start(); ?&#62; &#60;script language=javascript&#62; function SetCookie(cookieName,cookieValue,nDays) { alert(cookieName); var today = new Date(); var expire = new Date(); if (nDays==null &#124;&#124; nDays==0) nDays=1; expire.setTime(today.getTime() + 3600000*24*nDays); document.cookie [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeplatter123.wordpress.com&amp;blog=8811015&amp;post=33&amp;subd=codeplatter123&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Source  – <a title="http://dev.codeplatter.com" href="http://dev.codeplatter.com/" target="_blank">http://dev.codeplatter.com<br />
</a>Official Website – <a title="http://www.codeplatter.com/" href="http://www.codeplatter.com/" target="_blank">http://www.codeplatter.com/</a></p>
<p>Below is the PHP code to retrieve the Width and Height of Browser window using PHP.<br />
========== Code Starts =============<br />
&lt;?php<br />
session_start();<br />
?&gt;<br />
&lt;script language=javascript&gt;<br />
function SetCookie(cookieName,cookieValue,nDays) {<br />
alert(cookieName);<br />
var today = new Date();<br />
var expire = new Date();<br />
if (nDays==null || nDays==0) nDays=1;<br />
expire.setTime(today.getTime() + 3600000*24*nDays);<br />
document.cookie = cookieName+&#8221;=&#8221;+escape(cookieValue)+ &#8220;;expires=&#8221;+expire.toGMTString();<br />
}<br />
&lt;/script&gt;<br />
&lt;?php<br />
$browser_size=&#8221;";<br />
if(isset($_COOKIE["windsize"]))<br />
{<br />
$browser_size=$_COOKIE["windsize"];<br />
}<br />
else<br />
{<br />
echo&#8221;&lt;script language=javascript&gt;&#8221;;<br />
echo &#8220;var wsize=screen.width+&#8217;X'+screen.height;&#8221;;<br />
echo&#8221;SetCookie(&#8216;windsize&#8217;,wsize,1);&#8221;;<br />
echo&#8221;&lt;/script&gt;&#8221;;<br />
$browser_size=$_COOKIE["windsize"];<br />
}<br />
echo &#8221; the browser size is&#8221;.$browser_size;<br />
?&gt;<br />
========== Code Ends =============</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeplatter123.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeplatter123.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeplatter123.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeplatter123.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codeplatter123.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codeplatter123.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codeplatter123.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codeplatter123.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeplatter123.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeplatter123.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeplatter123.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeplatter123.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeplatter123.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeplatter123.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeplatter123.wordpress.com&amp;blog=8811015&amp;post=33&amp;subd=codeplatter123&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codeplatter123.wordpress.com/2009/08/17/php-script-find-browser-width-and-height/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a3029aa84cc06043d699d3a88ee8c44c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">codeplatter123</media:title>
		</media:content>
	</item>
		<item>
		<title>PHP-Nuke a powerful Open Source portal application</title>
		<link>http://codeplatter123.wordpress.com/2009/08/13/php-nuke-a-powerful-open-source-portal-application/</link>
		<comments>http://codeplatter123.wordpress.com/2009/08/13/php-nuke-a-powerful-open-source-portal-application/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 07:30:20 +0000</pubDate>
		<dc:creator>codeplatter123</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[PHP Development]]></category>

		<guid isPermaLink="false">http://codeplatter123.wordpress.com/?p=31</guid>
		<description><![CDATA[Source  – http://dev.codeplatter.com Official Website – http://www.codeplatter.com/ PHPNuke is a powerful Open Source portal application. It can be used as a weblog or as a CMS. PhpNuke allows webmasters and editors to easily post new content and comment existing articles. PHP Nuke is written in PHP and requires a MySQL database. Php-Nuke is one of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeplatter123.wordpress.com&amp;blog=8811015&amp;post=31&amp;subd=codeplatter123&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Source  – <a title="http://dev.codeplatter.com" href="http://dev.codeplatter.com/" target="_blank">http://dev.codeplatter.com<br />
</a>Official Website – <a title="http://www.codeplatter.com/" href="http://www.codeplatter.com/" target="_blank">http://www.codeplatter.com/</a></p>
<p>PHPNuke is a powerful Open Source portal application. It can be used as a weblog or as a CMS. PhpNuke allows webmasters and editors to easily post new content and comment existing articles. PHP Nuke is written in PHP and requires a MySQL database.<br />
Php-Nuke is one of the most popular tools for creating game clan websites. Php-Nuke has large supporting community and you can find lots of addon resources for your nuke software, like modules, integrations, themes, etc.</p>
<p>PHP-Nuke Modules, Blocks and Addons</p>
<p>There is no doubt that the most exciting feature of PHP-Nuke is its expanding capability through the use of modules, blocks and add-on components. We have chosen 3 major &#8216;upgrades&#8217; for phpNuke and will try to show you how easy is to install them.</p>
<p>Gallery in PHP-Nuke<br />
Forum component for PHP-Nuke<br />
E-commerce module for PHP-Nuke<br />
Also our Advanced Support Team can complete many modules, blocks and components installations for you. They can be purchased through the Exclusive Professional Services -&gt; Adding a module to an application ticketing category</p>
<p>Installation of Gallery to your PHP-Nuke site<br />
Title: Installation of Gallery to your PHP-Nuke site</p>
<p>There are several gallery modules that are available for PHPNuke. The Coppermine gallery is probably the most famous and easy-to-use one, However, since Coppermine Gallery and PHP-Nuke are now incorporated into one application called CPGnuke and are not available for integration anymore, we are going to install &#8216;Em&#8217;s eGallery&#8217; which is available for download here.</p>
<p>To install the gallery, you should first download the archive file and extract it on your local computer. This will create 2 new directories: db/ and html/. The db/ directory contains the database update script we will need in order to install the database structure for the gallery and the html/ directory contains the files needed by phpNuke for the installation. Please, open your favorite FTP client, connect via FTP to your web hosting account and navigate to the directory where phpNuke is installed. Then upload all the files and directories found under the html/ directory in the Gallery extracted archive file.</p>
<p>Once you complete the upload, you should import the database tables that come with Em&#8217;s eGallery script. To do so, please open your CPanel and select the phpMyAdmin tool. Click on it and a new page will load. From the drop-down menu at the left-hand side, please select the PHP-Nuke database you have created and wait for the right-hand side of the screen to update. Then click on &#8216;SQL&#8217; tab and paste inside the window the content of the &#8216;emsgallery.sql&#8217; file. Click on the [Go] button. In this way you will import the gallery tables in the PHP-Nuke Database.</p>
<p>Once both the files are uploaded and the database is imported all you have to do is to configure your new gallery module. Please, go to your PHP-Nuke admin screen and click on the new icon for Em&#8217;s eGallery:</p>
<p>Scroll down a little and click on the &#8216;Gallery Settings&#8217; link. From the &#8216;Gallery Settings&#8217; page, please click on the [Edit Gallery Config] button. The only setting that you need to configure is &#8216;Server Upload Directory&#8217; value.</p>
<p>It should be:</p>
<p>/home/user/public_html/modules/emsGallery/images</p>
<p>where &#8220;user&#8221; should be replaced by your actual CPanel username. You can change the other settings according to your personal preference. Save the configuration and you will have a nice and simple to use gallery integrated into PHPNuke.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeplatter123.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeplatter123.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeplatter123.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeplatter123.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codeplatter123.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codeplatter123.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codeplatter123.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codeplatter123.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeplatter123.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeplatter123.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeplatter123.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeplatter123.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeplatter123.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeplatter123.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeplatter123.wordpress.com&amp;blog=8811015&amp;post=31&amp;subd=codeplatter123&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codeplatter123.wordpress.com/2009/08/13/php-nuke-a-powerful-open-source-portal-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a3029aa84cc06043d699d3a88ee8c44c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">codeplatter123</media:title>
		</media:content>
	</item>
		<item>
		<title>How to start a career in Dot Net!!</title>
		<link>http://codeplatter123.wordpress.com/2009/08/07/how-to-start-a-career-in-dot-net/</link>
		<comments>http://codeplatter123.wordpress.com/2009/08/07/how-to-start-a-career-in-dot-net/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 09:22:01 +0000</pubDate>
		<dc:creator>codeplatter123</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[.net dovelepment]]></category>

		<guid isPermaLink="false">http://codeplatter123.wordpress.com/2009/08/07/how-to-start-a-career-in-dot-net/</guid>
		<description><![CDATA[Source  – http://dev.codeplatter.com Official Website – http://www.codeplatter.com/ This is My first article to this developers forum.This will sure help all new programmer who wants to work in Microsoft .Net Technology. the tips are as following: 1). Select which type of application you want to develop i.e. you have to select Web applications or Desktop applications. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeplatter123.wordpress.com&amp;blog=8811015&amp;post=29&amp;subd=codeplatter123&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Source  – <a title="http://dev.codeplatter.com" href="http://dev.codeplatter.com/" target="_blank">http://dev.codeplatter.com<br />
</a>Official Website – <a title="http://www.codeplatter.com/" href="http://www.codeplatter.com/" target="_blank">http://www.codeplatter.com/</a></p>
<p>This is My first article to this developers forum.This will sure help all new programmer who wants to work in Microsoft .Net Technology.<br />
the tips are as following:<br />
1). Select which type of application you want to develop i.e. you have to select Web applications or Desktop applications.<br />
2). Learn one of the languages ( C# or VB.NET) .which you want to work like if you are comfortable with Visual Basic structure and syntax then go for VB.NET and if you like the OOPS concept and earlier worked with C language or C++ then C# will be the best option.<br />
3). Select any good book and please stick with it. Read all the chapters in it. and again STICK TO IT.<br />
4). Make some small applications.<br />
5). Visit http:// <!-- m --><a href="http://www.asp.net/">http://www.asp.net</a><!-- m --> regularly and other site like MSDN</p>
<p>Happy Dot Net Coding</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeplatter123.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeplatter123.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeplatter123.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeplatter123.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codeplatter123.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codeplatter123.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codeplatter123.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codeplatter123.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeplatter123.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeplatter123.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeplatter123.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeplatter123.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeplatter123.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeplatter123.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeplatter123.wordpress.com&amp;blog=8811015&amp;post=29&amp;subd=codeplatter123&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codeplatter123.wordpress.com/2009/08/07/how-to-start-a-career-in-dot-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a3029aa84cc06043d699d3a88ee8c44c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">codeplatter123</media:title>
		</media:content>
	</item>
		<item>
		<title>10 Tips For Query Optimization</title>
		<link>http://codeplatter123.wordpress.com/2009/08/03/10-tips-for-query-optimization/</link>
		<comments>http://codeplatter123.wordpress.com/2009/08/03/10-tips-for-query-optimization/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 09:14:02 +0000</pubDate>
		<dc:creator>codeplatter123</dc:creator>
				<category><![CDATA[1]]></category>

		<guid isPermaLink="false">http://codeplatter123.wordpress.com/?p=24</guid>
		<description><![CDATA[Source  – http://dev.codeplatter.com Official Website – http://www.codeplatter.com/ 1. The rule in any situation where you want to opimize some code is that you first profile it and then find the bottlenecks. Mr. Silverton, however, aims right for the tippy top of the trees. I&#8217;d say 60% of database optimization is properly understanding SQL and the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeplatter123.wordpress.com&amp;blog=8811015&amp;post=24&amp;subd=codeplatter123&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Source  – <a title="http://dev.codeplatter.com" href="http://dev.codeplatter.com/" target="_blank">http://dev.codeplatter.com<br />
</a>Official Website – <a title="http://www.codeplatter.com/" href="http://www.codeplatter.com/" target="_blank">http://www.codeplatter.com/</a></p>
<p>1. The rule in any situation where you want to opimize some code is that you first profile it and then find the bottlenecks. Mr. Silverton, however, aims right for the tippy top of the trees. I&#8217;d say 60% of database optimization is properly understanding SQL and the basics of databases. You need to understand joins vs. subselects, column indices, how to normalize data, etc. The next 35% is understanding the performance characteristics of your database of choice. COUNT(*) in MySQL, for example, can either be almost-free or painfully slow depending on which storage engine you&#8217;re using. Other things to consider: under what conditions does your database invalidate caches, when does it sort on disk rather than in memory, when does it need to create temporary tables, etc. The final 5%, where few ever need venture, is where Mr. Silverton spends most of his time. Never once in my life have I used SQL_SMALL_RESULT.[/b]1. The rule in any situation where you want to opimize some code is that you first profile it and then find the bottlenecks. Mr. Silverton, however, aims right for the tippy top of the trees. I&#8217;d say 60% of database optimization is properly understanding SQL and the basics of databases. You need to understand joins vs. subselects, column indices, how to normalize data, etc. The next 35% is understanding the performance characteristics of your database of choice. COUNT(*) in MySQL, for example, can either be almost-free or painfully slow depending on which storage engine you&#8217;re using. Other things to consider: under what conditions does your database invalidate caches, when does it sort on disk rather than in memory, when does it need to create temporary tables, etc. The final 5%, where few ever need venture, is where Mr. Silverton spends most of his time. Never once in my life have I used SQL_SMALL_RESULT.[/b]1. The rule in any situation where you want to opimize some code is that you first profile it and then find the bottlenecks. Mr. Silverton, however, aims right for the tippy top of the trees. I&#8217;d say 60% of database optimization is properly understanding SQL and the basics of databases. You need to understand joins vs. subselects, column indices, how to normalize data, etc. The next 35% is understanding the performance characteristics of your database of choice. COUNT(*) in MySQL, for example, can either be almost-free or painfully slow depending on which storage engine you&#8217;re using. Other things to consider: under what conditions does your database invalidate caches, when does it sort on disk rather than in memory, when does it need to create temporary tables, etc. The final 5%, where few ever need venture, is where Mr. Silverton spends most of his time. Never once in my life have I used SQL_SMALL_RESULT.[/b]1. The rule in any situation where you want to opimize some code is that you first profile it and then find the bottlenecks. Mr. Silverton, however, aims right for the tippy top of the trees. I&#8217;d say 60% of database optimization is properly understanding SQL and the basics of databases. You need to understand joins vs. subselects, column indices, how to normalize data, etc. The next 35% is understanding the performance characteristics of your database of choice. COUNT(*) in MySQL, for example, can either be almost-free or painfully slow depending on which storage engine you&#8217;re using. Other things to consider: under what conditions does your database invalidate caches, when does it sort on disk rather than in memory, when does it need to create temporary tables, etc. The final 5%, where few ever need venture, is where Mr. Silverton spends most of his time. Never once in my life have I used SQL_SMALL_RESULT.</p>
<p>2. There are cases when Mr. Silverton does note a good problem. MySQL will indeed use a dynamic row format if it contains variable length fields like TEXT or BLOB, which, in this case, means sorting needs to be done on disk. The solution is not to eschew these datatypes, but rather to split off such fields into an associated table. The following schema represents this idea:</p>
<p>CREATE TABLE posts (<br />
id int UNSIGNED NOT NULL AUTO_INCREMENT,<br />
author_id int UNSIGNED NOT NULL,<br />
created timestamp NOT NULL,<br />
PRIMARY KEY(id)<br />
);</p>
<p>CREATE TABLE posts_data (<br />
post_id int UNSIGNED NOT NULL.<br />
body text,<br />
PRIMARY KEY(post_id)<br />
);</p>
<p>3. Some of his suggestions are just mind-boggling, e.g., &#8220;remove unnecessary paratheses.&#8221; It really doesn&#8217;t matter whether you do SELECT * FROM posts WHERE (author_id = 5 AND published = 1) or SELECT * FROM posts WHERE author_id = 5 AND published = 1. None. Any decent DBMS is going to optimize these away. This level of detail is akin to wondering when writing a C program whether the post-increment or pre-increment operator is faster. Really, if that&#8217;s where you&#8217;re spending your energy, it&#8217;s a surprise you&#8217;ve written any code at all</p>
<p>My list<br />
Let&#8217;s see if I fare any better. I&#8217;m going to start from the most general.</p>
<p>4. You&#8217;re going to need numbers if you want to make a good decision. What queries are the worst? Where are the bottlenecks? Under what circumstances am I generating bad queries? Benchmarking is will let you simulate high-stress situations and, with the aid of profiling tools, expose the cracks in your database configuration. Tools of the trade include supersmack, ab, and SysBench. These tools either hit your database directly (e.g., supersmack) or simulate web traffic (e.g., ab).</p>
<p>5. So, you&#8217;re able to generate high-stress situations, but now you need to find the cracks. This is what profiling is for. Profiling enables you to find the bottlenecks in your configuration, whether they be in memory, CPU, network, disk I/O, or, what is more likely, some combination of all of them.</p>
<p>The very first thing you should do is turn on the MySQL slow query log and install mtop. This will give you access to information about the absolute worst offenders. Have a ten-second query ruining your web application? These guys will show you the query right off.</p>
<p>6. Before you even start writing queries you have to design a schema. Remember that the memory requirements for a table are going to be around #entries * size of a row. Unless you expect every person on the planet to register 2.8 trillion times on your website you do not in fact need to make your user_id column a BIGINT. Likewise, if a text field will always be a fixed length (e.g., a US zipcode, which always has a canonical representation of the form &#8220;XXXXX-XXXX&#8221;) then a VARCHAR declaration just adds a superfluous byte for every row.</p>
<p>Some people poo-poo database normalization, saying it produces unecessarily complex schema. However, proper normalization results in a minimization of redundant data. Fundamentally that means a smaller overall footprint at the cost of performance — the usual performance/memory tradeoff found everywhere in computer science. The best approach, IMO, is to normalize first and denormalize where performance demands it. Your schema will be more logical and you won&#8217;t be optimizing prematurely.<br />
After you&#8217;ve identified the slow queries you should learn about the MySQL internal tools, like EXPLAIN, SHOW STATUS, and SHOW PROCESSLIST. These will tell you what resources are being spent where, and what side effects your queries are having, e.g., whether your heinous triple-join subselect query is sorting in memory or on disk. Of course, you should also be using your usual array of command-line profiling tools like top, procinfo, vmstat, etc. to get more general system performance information.</p>
<p>7. Often you have a table in which only a few columns are accessed frequently. On a blog, for example, one might display entry titles in many places (e.g., a list of recent posts) but only ever display teasers or the full post bodies once on a given page. Horizontal vertical partitioning helps:</p>
<p>CREATE TABLE posts (<br />
id int UNSIGNED NOT NULL AUTO_INCREMENT,<br />
author_id int UNSIGNED NOT NULL,<br />
title varchar(128),<br />
created timestamp NOT NULL,<br />
PRIMARY KEY(id)<br />
);</p>
<p>CREATE TABLE posts_data (<br />
post_id int UNSIGNED NOT NULL,<br />
teaser text,<br />
body text,<br />
PRIMARY KEY(post_id)<br />
);<br />
The above represents a situation where one is optimizing for reading. Frequently accessed data is kept in one table while infrequently accessed data is kept in another. Since the data is now partitioned the infrequently access data takes up less memory. You can also optimize for writing: frequently changed data can be kept in one table, while infrequently changed data can be kept in another. This allows more efficient caching since MySQL no longer needs to expire the cache for data which probably hasn&#8217;t changed.</p>
<p>8. Artificial primary keys are nice because they can make the schema less volatile. If we stored geography information in the US based on zip code, say, and the zip code system suddenly changed we&#8217;d be in a bit of trouble. On the other hand, many times there are perfectly fine natural keys. One example would be a join table for many-to-many relationships. What not to do:</p>
<p>CREATE TABLE posts_tags (<br />
relation_id int UNSIGNED NOT NULL AUTO_INCREMENT,<br />
post_id int UNSIGNED NOT NULL,<br />
tag_id int UNSIGNED NOT NULL,<br />
PRIMARY KEY(relation_id),<br />
UNIQUE INDEX(post_id, tag_id)<br />
);<br />
Not only is the artificial key entirely redundant given the column constraints, but the number of post-tag relations are now limited by the system-size of an integer. Instead one should do:</p>
<p>CREATE TABLE posts_tags (<br />
post_id int UNSIGNED NOT NULL,<br />
tag_id int UNSIGNED NOT NULL,<br />
PRIMARY KEY(post_id, tag_id)<br />
);</p>
<p>9. Often your choice of indices will make or break your database. For those who haven&#8217;t progressed this far in their database studies, an index is a sort of hash. If we issue the query SELECT * FROM users WHERE last_name = &#8216;Goldstein&#8217; and last_name has no index then your DBMS must scan every row of the table and compare it to the string &#8216;Goldstein.&#8217; An index is usually a B-tree (though there are other options) which speeds up this comparison considerably.</p>
<p>You should probably create indices for any field on which you are selecting, grouping, ordering, or joining. Obviously each index requires space proportional to the number of rows in your table, so too many indices winds up taking more memory. You also incur a performance hit on write operations, since every write now requires that the corresponding index be updated. There is a balance point which you can uncover by profiling your code. This varies from system to system and implementation to implementation.</p>
<p>10. C is the canonical procedural programming language and the greatest pitfall for a programmer looking to show off his database-fu is that he fails to realize that SQL is not procedural (nor is it functional or object-oriented, for that matter). Rather than thinking in terms of data and operations on data one must think of sets of data and relationships among those sets. This usually crops up with the improper use of a subquery:</p>
<p>SELECT a.id,<br />
(SELECT MAX(created)<br />
FROM posts<br />
WHERE author_id = a.id)<br />
AS latest_post<br />
FROM authors a<br />
Since this subquery is correlated, i.e., references a table in the outer query, one should convert the subquery to a join.</p>
<p>SELECT a.id, MAX(p.created) AS latest_post<br />
FROM authors a<br />
INNER JOIN posts p<br />
ON (a.id = p.author_id)<br />
GROUP BY a.id</p>
<p>11. MySQL has two primary storange engines: MyISAM and InnoDB. Each has its own performance characteristics and considerations. In the broadest sense MyISAM is good for read-heavy data and InnoDB is good for write-heavy data, though there are cases where the opposite is true. The biggest gotcha is how the two differ with respect to the COUNT function.</p>
<p>MyISAM keeps an internal cache of table meta-data like the number of rows. This means that, generally, COUNT(*) incurs no additional cost for a well-structured query. InnoDB, however, has no such cache. For a concrete example, let&#8217;s say we&#8217;re trying to paginate a query. If you have a query SELECT * FROM users LIMIT 5,10, let&#8217;s say, running SELECT COUNT(*) FROM users LIMIT 5,10 is essentially free with MyISAM but takes the same amount of time as the first query with InnoDB. MySQL has a SQL_CALC_FOUND_ROWS option which tells InnoDB to calculate the number of rows as it runs the query, which can then be retreived by executing SELECT FOUND_ROWS(). This is very MySQL-specific, but can be necessary in certain situations, particularly if you use InnoDB for its other features (e.g., row-level locking, stored procedures, etc.).</p>
<p>12 . MySQL provides many extentions to SQL which help performance in many common use scenarios. Among these are INSERT … SELECT, INSERT … ON DUPLICATE KEY UPDATE, and REPLACE.</p>
<p>I rarely hesitate to use the above since they are so convenient and provide real performance benefits in many situations. MySQL has other keywords which are more dangerous, however, and should be used sparingly. These include INSERT DELAYED, which tells MySQL that it is not important to insert the data immediately (say, e.g., in a logging situation). The problem with this is that under high load situations the insert might be delayed indefinitely, causing the insert queue to baloon. You can also give MySQL index hints about which indices to use. MySQL gets it right most of the time and when it doesn&#8217;t it is usually because of a bad scheme or poorly written query.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeplatter123.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeplatter123.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeplatter123.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeplatter123.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codeplatter123.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codeplatter123.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codeplatter123.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codeplatter123.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeplatter123.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeplatter123.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeplatter123.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeplatter123.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeplatter123.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeplatter123.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeplatter123.wordpress.com&amp;blog=8811015&amp;post=24&amp;subd=codeplatter123&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codeplatter123.wordpress.com/2009/08/03/10-tips-for-query-optimization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a3029aa84cc06043d699d3a88ee8c44c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">codeplatter123</media:title>
		</media:content>
	</item>
		<item>
		<title>JSP compared to ASP &amp; ASP.NET</title>
		<link>http://codeplatter123.wordpress.com/2009/08/02/jsp-compared-to-asp-asp-net/</link>
		<comments>http://codeplatter123.wordpress.com/2009/08/02/jsp-compared-to-asp-asp-net/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 04:19:31 +0000</pubDate>
		<dc:creator>codeplatter123</dc:creator>
				<category><![CDATA[1]]></category>
		<category><![CDATA[JAVA Development]]></category>

		<guid isPermaLink="false">http://codeplatter123.wordpress.com/?p=20</guid>
		<description><![CDATA[Source  – http://dev.codeplatter.com Official Website – http://www.codeplatter.com/ JSP(Java Server Pages) compared to ASP(Active Server Pages) JSP and ASP Provides fairly similar functionality . JSP may have slightly higher learning curve. In JSP &#38; ASP we use embedded code in an HTML page,session variables and database access and manipulation. ASP is mostly found on Microsoft platforms [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeplatter123.wordpress.com&amp;blog=8811015&amp;post=20&amp;subd=codeplatter123&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Source  – <a title="http://dev.codeplatter.com" href="http://dev.codeplatter.com/" target="_blank">http://dev.codeplatter.com<br />
</a>Official Website – <a title="http://www.codeplatter.com/" href="http://www.codeplatter.com/" target="_blank">http://www.codeplatter.com/</a></p>
<p><span style="font-weight:bold;">JSP(Java Server Pages) compared to ASP(Active Server Pages)</span></p>
<p>JSP and ASP Provides fairly similar functionality . JSP may have slightly higher learning curve. In  JSP &amp; ASP we<br />
use embedded code in an HTML page,session variables and database access and manipulation. ASP is mostly found<br />
on Microsoft platforms i.e.Windows NT,2000.<br />
JSP can operate on any platform that conforms to the J2EE specification. JSP allow component reuse by using<br />
Javabeans and EJBs. ASP provides the use of COM / ActiveX controls.</p>
<p><span style="font-weight:bold;">Java Server Pages(JSP) compared to ASP.NET</span></p>
<p>ASP.NET is based on the Microsoft .NET framework. The .NET framework allows applications to be developed<br />
using different programming languages such as Visual C++,Visual Basic,C# and JavaScript &amp; many more. JSP<br />
and Java still has the advantage that it is supported on many different platforms and the Java community has many<br />
years of experience in designing and developing Enterprise quality scalable applications. Basically ASP.NET is a<br />
Advance Version of ASP.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeplatter123.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeplatter123.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeplatter123.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeplatter123.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codeplatter123.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codeplatter123.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codeplatter123.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codeplatter123.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeplatter123.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeplatter123.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeplatter123.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeplatter123.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeplatter123.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeplatter123.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeplatter123.wordpress.com&amp;blog=8811015&amp;post=20&amp;subd=codeplatter123&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codeplatter123.wordpress.com/2009/08/02/jsp-compared-to-asp-asp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a3029aa84cc06043d699d3a88ee8c44c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">codeplatter123</media:title>
		</media:content>
	</item>
		<item>
		<title>PHP Security</title>
		<link>http://codeplatter123.wordpress.com/2009/08/02/php-security/</link>
		<comments>http://codeplatter123.wordpress.com/2009/08/02/php-security/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 04:15:28 +0000</pubDate>
		<dc:creator>codeplatter123</dc:creator>
				<category><![CDATA[1]]></category>
		<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[PHP Security]]></category>

		<guid isPermaLink="false">http://codeplatter123.wordpress.com/?p=18</guid>
		<description><![CDATA[Source  – http://dev.codeplatter.com Official Website – http://www.codeplatter.com/ 1. Introduction Writing PHP applications is pretty easy. Most people grasp the syntax rather quickly and will within short time be able to produce a script that works using tutorials, references, books, and help forum forums like the one we have here at PHP Freaks. The problem is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeplatter123.wordpress.com&amp;blog=8811015&amp;post=18&amp;subd=codeplatter123&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Source  – <a title="http://dev.codeplatter.com" href="http://dev.codeplatter.com/" target="_blank">http://dev.codeplatter.com<br />
</a>Official Website – <a title="http://www.codeplatter.com/" href="http://www.codeplatter.com/" target="_blank">http://www.codeplatter.com/</a></p>
<p><span style="font-weight:bold;">1. Introduction</span><br />
Writing PHP applications is pretty easy. Most people grasp the syntax rather quickly and will within short time be able to produce a script that works using tutorials, references, books, and help forum forums like the one we have here at PHP Freaks. The problem is that most people forget one of the most important aspects that one must consider when writing PHP applications. Many beginners forget the security aspect of PHP. Generally, your users are nice people, they will do as they are told and you will have no problem with these people whatsoever. However, some people are not quite as nice. Some people are outright malicious and are seeking to do damage on your website. They will scrutinize your application for security flaws and exploit these holes. Many times the beginner programmer did not know that these things would even be a problem and therefore it might be a problem to fix the holes. In this tutorial we will look at some of these issues so you can learn how to deal with them, and better yet, prevent them. Obviously I will not promise you that by following this tutorial you will never get successfully attacked. As you become bigger you will also become a bigger and therefore more interesting target &#8211; something we have experienced ourselves here at PHP Freaks.</p>
<p>On the next page we will look at how we should do our error reporting.</p>
<p>This tutorial is available for download as a PDF file here. That version can be read offline or printed.</p>
<p><span style="font-weight:bold;">2. Error reporting</span><br />
Error reporting is a good thing, right? It gives you valuable insight into why your application failed. It gives you useful information such as what happened and where it happened. This information is essential in order to fix the bug. However, you might not be the only one who is interested in knowing why your application failed. By giving the user the details from the errors and/or exceptions thrown by PHP you are giving valuable insight into how your application works. Apart from the source itself, this is one of the most valuable intelligence the attacker might gather when looking for vulnerabilities in your application. Therefore, you should never output the error to the screen when your application is running in a production environment (the live setting in which your application runs when it is available for public use). In your development environment (e.g. on your local computer) it is perfectly fine to output the errors because there are nobody but you to see them and it is easier than having to check an error log when something fails unexpectedly.</p>
<p>So what should you do when you have launched your new killer app? Bugs might still appear and you need the before-mentioned information in order to fix them. What you can do, and should do, is write the errors into a log file. Actually, PHP does insert all errors into a log file on the server by default. However, if you are on shared hosting then you will most likely not have access to that file and it will therefore be necessary to write it into your own file. There are a couple of php.ini directives that are relevant to our problem:</p>
<p>display_errors this directive controls whether PHP errors should be sent to the screen. In a production environment this should always be turned off.<br />
error_reporting this directive controls which errors that should be reported. You should set this to E_ALL and you should fix all issues that appear by doing this.<br />
log_errors this controls whether errors should be logged to a file. I would recommend that you always turn this on.<br />
error_log this is the path of the file errors should be written to. This is only applies if log_errors is turned on obviously.<br />
Here is how I would recommend that you configure the before-mentioned four directives:</p>
<p>Table 2.1: Recommended Configuration<br />
Directive name:	Production:	Development:<br />
display_errors	Off	On<br />
error_reporting	E_ALL	E_ALL<br />
log_errors	On	On<br />
error_log	varies	varies<br />
How error_log should be configured obviously depends on how your directory structure is setup (more on that later in this tutorial).</p>
<p>2.1. Setting the directives<br />
There are a number of different ways you can set the directives in order to achieve the most secure and efficient error handling as I talked about before. If you already know how to do that then you can skip this section.</p>
<p>First and foremost there is changing the values directly in php.ini. However, this is only possible if you are the administrator of the server so for many people this is not an option.</p>
<p>Apache has some configuration files called .htaccess where you can configure Apache directives for the particular folder (and sub-folders) the file is located in. Some hosts do not allow you to use this, but if you can then the PHP module has a directive called php_flag which allows you to set PHP directives. You simply do it like this:</p>
<p>php_flag directive_name directive_value<br />
Note that you cannot use constants like E_ALL so you will have to use their numeric values. E_ALL&#8217;s value is currently 8191, but that might change in the future so you should check the new value if you update a major version. You can see the constants regarding error reporting at any time here.</p>
<p>So for our production environment you can do this:</p>
<p>php_flag display_errors off<br />
php_flag error_reporting 8191<br />
php_flag log_errors on<br />
php_flag error_log /home/someone/logs/php_errors.log<br />
A third option is to use to use PHP&#8217;s ini_set() function. That function takes two arguments: the name of the directive to set and its new value. You can use the constants here. There is a function called error_reporting() which you can use to set the error reporting instead.</p>
<p><span style="font-weight:bold;">3. SQL injections</span><br />
One of the most common problems with security in web applications is SQL injection. To begin with I will present this comic for you:</p>
<p>The comic clearly illustrates the problems with SQL injection. If you do not get it, do not worry, you will in just a moment.</p>
<p>SQL injections work by injecting SQL into the queries you have already written in your script. Often you will pass some sort of variable data to your queries; this data might be influenced by user input. In the above comment we might imagine that the school had a query that looks something like this:</p>
<p>$sql = &#8220;INSERT INTO Students (name) VALUES (&#8216;{$_POST['student_name']}&#8217;)&#8221;;<br />
The above snippet works. As long as users input data that conforms to an expected format. Now, the mother in the comic did not provide expected data, rather she injected an entire additional query into the existing query. Let&#8217;s take a look at how the query looks when we enter the string given by the mother:</p>
<p>INSERT INTO students (name) VALUES (&#8216;Robert&#8217;); DROP TABLE Students;&#8211;&#8217;)<br />
(Note: PHP does not support stacking queries with all DBMSs. MySQL in particular)</p>
<p>As you probably know, a semi-colon ends a query and most times it is actually required, but PHP just adds it automatically if you omit it. Therefore, by closing the string and finishing the query by entering the closing parenthesis and a semi-colon we will be able to add an additional query that drops the student table. The two hyphens at the end make whatever comes after it a comment, so whatever remaining characters that might have been in the original query will simply be ignored.</p>
<p>It should not take too much brain power to figure out why this is a bad thing. Malicious users will basically be able to execute any kind of queries they would like to. This can be done for various purposes. It could be retrieving confidential information or destroying your data just to name a few.</p>
<p>3.1. Protecting your script from SQL injections<br />
Fortunately, protecting yourself from SQL injections is rather easy. It is just a matter of calling a single function which make data safe for use in a query. How you should do this depends on which PHP extension you are using. Many people use the regular mysql extension, so let us start with that one. That particular extension has a function called mysql_real_escape_string(). Let us take a look at how that one works with a simple example that illustrates its usage:</p>
<p>&lt;?php<br />
$db = mysql_connect(&#8216;localhost&#8217;, &#8216;username&#8217;, &#8216;password&#8217;);<br />
mysql_select_db(&#8216;school&#8217;, $db);</p>
<p>$studentName = mysql_real_escape_string($_POST['student_name'], $db);</p>
<p>$queryResult = mysql_query(&#8220;INSERT INTO Students (name) VALUE (&#8216;{$studentName}&#8217;)&#8221;);</p>
<p>if ($queryResult) {<br />
echo &#8216;Success.&#8217;;<br />
}<br />
else {<br />
echo &#8216;Insertion failed. Please try again.&#8217;;<br />
}<br />
?&gt;<br />
As you see, doing it is incredibly easy yet many people fail to do this and only find out when it is too late. Other extensions support something called prepared statements. An example of a such extension is PDO (PHP Data Objects). Let us take a look at how that works:<br />
&lt;?php<br />
$db = new PDO(&#8216;mysql:host=localhost;dbname=school&#8217;, &#8216;username&#8217;, &#8216;password&#8217;);</p>
<p>$stmt = $db-&gt;prepare(&#8216;INSERT INTO Students (name) VALUES (?)&#8217;);</p>
<p>try {<br />
$stmt-&gt;execute(array($_POST['student_name']));<br />
echo &#8216;Success.&#8217;;<br />
}<br />
catch(PDOException $e) {<br />
echo &#8216;Insertion failed. Please try again.&#8217;;<br />
}<br />
?&gt;<br />
If you have many fields you need to use in your query then it might be a little difficult remembering the order of all these different question marks which act as place holders for the data. An alternate syntax is using named parameters. In our case it would look like this:<br />
&lt;?php<br />
$db = new PDO(&#8216;mysql:host=localhost;dbname=school&#8217;, &#8216;username&#8217;, &#8216;password&#8217;);</p>
<p>$stmt = $db-&gt;prepare(&#8216;INSERT INTO Students (name) VALUES (:name)&#8217;);</p>
<p>try {<br />
$stmt-&gt;execute(array(&#8216;name&#8217; =&gt; $_POST['student_name']));<br />
echo &#8216;Success.&#8217;;<br />
}<br />
catch(PDOException $e) {<br />
echo &#8216;Insertion failed. Please try again.&#8217;;<br />
}<br />
?&gt;<br />
Obviously, in our case this would not have any benefits, but as I said, if you have many parameters then you might find that more useful. There can be other reasons why using prepared statements would be useful, but I will leave that to research for yourself.</p>
<p>The mysqli (MySQL improved) extension has support for prepared statements as well, so if you are using that then check out its documentation to see the syntax.</p>
<p>The golden rule regarding this is that nothing is to be trusted and all data should be escaped.</p>
<p>Additionally, I mentioned earlier that users should not get information from error messages. Not only is it irrelevant, but it may also be information that may aid people with malicious purposes. You may sometimes be told that you should add or die(mysql_error()) to the end of your query calls to functions like mysql_query(). However, you should not do that. By doing that you are no longer using PHP&#8217;s error and exception handling functionality and you remove the opportunity to control whether errors should be displayed or not. In my opinion the best solution would be to use PHP&#8217;s exceptions. If you do not want to do that then at least do something like or trigger_error(&#8216;Query failed: &#8216;. mysql_error()). By doing that you are utilizing PHP&#8217;s built-in functionality and you will be able to use the methods discussed under Error Reporting. Moreover, ending script execution with die() is simply bad practice. You will not be able to give the user a proper error page and you will not be able to do any cleaning up for the rest of the script.</p>
<p><span style="font-weight:bold;">4. Cross Site Scripting</span><br />
Cross-Site Scripting, abbreviated XSS, is another common security issue. This issue is relevant whenever content that comes from the user will be redisplayed on the screen. It is essentially when Javascript is injected into the HTML source. We could for instance imaging a forum. On a forum users will be able to post messages that will be displayed for other users. We want the users to be able to format their messages and HTML is just perfect for that, right? There is just a minor problem&#8230; Not all users are equally nice. The same kind of people that might want to drop the school&#8217;s student table from the previous section might also want to do something here. Specifically what they might want to do is insert Javascript into the source. This might be for various purposes. It could be simply for annoying by creating an infinite loop of alert messages which would force the user to shutdown the browser or it could be redirecting the users to websites such as goatse or tubgirl (you might not want to check what it is if you do not already know). Other, more sofisticated attacks, could be writing a keylogger that logs and sends keystrokes (such as passwords) to an external website or the injected Javascript could be retrieving the users&#8217; cookies (more on the latter later in this tutorial).</p>
<p>4.1. XSS Protection<br />
As a matter of fact, this is rather easy to protect yourself from as well. PHP has a nifty function that is useful in this instance which is called htmlentities(). It will simply convert characters which have a meaning in HTML to their corresponding entities. For instance, HTML tags start with a lower-than sign and that particular character will be converted to &amp;lt;. If you care about validation of your HTML (and you should!) then this will also help along with that.</p>
<p>We just have one problem. Our original example was a forum system and we wanted to give the users the opportunity to format their posts. However, the fix we just implemented removed this opportunity so we need to give them an alternate one. One with which we can control what they may do and not do. A common feature is called bbcodes. It has a syntax very similar to HTML and I am quite sure you are familiar with it if you have ever frequented any forum. Be aware though! You might get some additional XSS security holes with some tags.</p>
<p>A common bbcode tag is the URL tag. We could imagine that someone entered</p>
<p><a href="http://www.phpfreaks.com/">The best PHP website</a><br />
which would be converted to:</p>
<p>&lt;a href=&#8221;http://www.phpfreaks.com&#8221;&gt;The best PHP website&lt;/a&gt;<br />
. At first glance there is no issue with allowing that. However, URLs like javascript:alert(&#8216;Hi&#8217;) are also allowed and they will, obviously, execute the entered Javascript. Similarly, in some lower versions of Internet Explorer (IE6 and below) that URL format is allowed and will execute Javascript so we have to take care of that as well.</p>
<p>For both the two before mentioned instances we might want to check that the protocol is one we would allow. It would be better to create a white-list of allowed protocols instead of creating a black-list of disallowed protocols. Simply select the protocols you want (e.g. http, https and ftp) and disallow all other.</p>
<p>Finally, this XSS cheatsheet might be useful to you. Both when learning about XSS as well as testing that your application is secure.</p>
<p><span style="font-weight:bold;">4. Cross Site Scripting</span><br />
Cross-Site Scripting, abbreviated XSS, is another common security issue. This issue is relevant whenever content that comes from the user will be redisplayed on the screen. It is essentially when Javascript is injected into the HTML source. We could for instance imaging a forum. On a forum users will be able to post messages that will be displayed for other users. We want the users to be able to format their messages and HTML is just perfect for that, right? There is just a minor problem&#8230; Not all users are equally nice. The same kind of people that might want to drop the school&#8217;s student table from the previous section might also want to do something here. Specifically what they might want to do is insert Javascript into the source. This might be for various purposes. It could be simply for annoying by creating an infinite loop of alert messages which would force the user to shutdown the browser or it could be redirecting the users to websites such as goatse or tubgirl (you might not want to check what it is if you do not already know). Other, more sofisticated attacks, could be writing a keylogger that logs and sends keystrokes (such as passwords) to an external website or the injected Javascript could be retrieving the users&#8217; cookies (more on the latter later in this tutorial).</p>
<p>4.1. XSS Protection<br />
As a matter of fact, this is rather easy to protect yourself from as well. PHP has a nifty function that is useful in this instance which is called htmlentities(). It will simply convert characters which have a meaning in HTML to their corresponding entities. For instance, HTML tags start with a lower-than sign and that particular character will be converted to &amp;lt;. If you care about validation of your HTML (and you should!) then this will also help along with that.</p>
<p>We just have one problem. Our original example was a forum system and we wanted to give the users the opportunity to format their posts. However, the fix we just implemented removed this opportunity so we need to give them an alternate one. One with which we can control what they may do and not do. A common feature is called bbcodes. It has a syntax very similar to HTML and I am quite sure you are familiar with it if you have ever frequented any forum. Be aware though! You might get some additional XSS security holes with some tags.</p>
<p>A common bbcode tag is the URL tag. We could imagine that someone entered</p>
<p><a href="http://www.phpfreaks.com/">The best PHP website</a><br />
which would be converted to:</p>
<p>&lt;a href=&#8221;http://www.phpfreaks.com&#8221;&gt;The best PHP website&lt;/a&gt;<br />
. At first glance there is no issue with allowing that. However, URLs like javascript:alert(&#8216;Hi&#8217;) are also allowed and they will, obviously, execute the entered Javascript. Similarly, in some lower versions of Internet Explorer (IE6 and below) that URL format is allowed and will execute Javascript so we have to take care of that as well.</p>
<p>For both the two before mentioned instances we might want to check that the protocol is one we would allow. It would be better to create a white-list of allowed protocols instead of creating a black-list of disallowed protocols. Simply select the protocols you want (e.g. http, https and ftp) and disallow all other.</p>
<p>Finally, this XSS cheatsheet might be useful to you. Both when learning about XSS as well as testing that your application is secure.</p>
<p><span style="font-weight:bold;">5. Outside file access</span><br />
Normally, pages ending with .php will be handled forwarded to PHP by Apache and therefore the code will be hidden from the users. That the source code is hidden is one of the things that characterizes server-side scripting languages such as PHP. However, the PHP module or Apache might fail and the code might be displayed in plain unparsed text to the user. This is definitely not good. First of all, if the source is visible then it is much easier to find security issues in your application. Additionally, some scripts contain configuration files within the document root (the directory in which all files and sub-folders are publicly accessible from the outside world) and those will obviously not be parsed either thus presented to the user if they enter the filename into the URL. Personally I have experienced this before where I was on a small website and suddenly a misconfiguration of some sort displayed the source code to me. The website used a widely used application and I happened to know where the configuration file was. Sure enough, I was able to view that as well and from that I gathered the root password for the server (bad security practice to use the same password for multiple purposes and it is also bad security practice to use the root MySQL user). Being a nice person I did not do anything with it, but other people might not be as nice as I am and if you have the root password for a server then you can essentially do anything with it.</p>
<p>Another instance of this is the popular website Facebook which you have probably heard about in some way or another. What I explained before (server misconfiguration resulting in leaked source code) also has also happened to Facebook. Even big companies with people paid to configure the server apparently sometimes screws up and therefore it is necessary to take some security precautions in order to prevent source leakage if something like that should ever happen (something Facebook apparently did not).</p>
<p>It all has to do with how you layout your directory structure. So, all files within the document root can be retrieved by the user. Therefore we might as well move everything else out of there so people cannot directly access it. This means we might have index.php and some static files such as CSS, Javascript and images laying inside the document root. We can even take it further and do so the only thing that is in index.php is the following:<br />
&lt;?php<br />
require &#8216;../public_index.php&#8217;;<br />
?&gt;<br />
That particular snippet is the only thing the user will ever be able to see should something happen. So we might have a directory structure that looks like this:</p>
<p>/application<br />
/controllers<br />
/models<br />
/views<br />
/library<br />
/public_html &lt;&#8211; document root<br />
/index.php<br />
/media<br />
/images<br />
/javascript<br />
/css<br />
/config<br />
/cache<br />
/tmp<br />
/public_index.php<br />
/logs<br />
By laying out your files in this manner you will prevent that people will see things they are not supposed to see. It is easy to do so there is no reason why you would not.</p>
<p><span style="font-weight:bold;">6. Remote file inclusion</span><br />
Remote file inclusion attacks (sometimes abbreviated RFI) is a vulnerability many people probably do not know of, but it is a very serious issue that also must be addressed. As the name implies, it is when remote files are included, but what exactly does that? Let us look at an example:<br />
&lt;?php<br />
$page = isset($_GET['page']) ? $_GET['page'] : &#8216;home&#8217;;</p>
<p>require $page . &#8216;.php&#8217;;<br />
?&gt;<br />
This is a very basic front controller that will forward the request to whatever file that should be responsible for that particular request.</p>
<p>Imagine that at <!-- m --><a href="http://example.com/malice.php">http://example.com/malice.php</a><!-- m --> a file exists and our script is located at <!-- m --><a href="http://site.com/index.php">http://site.com/index.php</a><!-- m -->. The attacker will do this request: <!-- m --><a href="http://site.com/index.php?page=http://example.com/malice">http://site.com/index.php?page=http://e &#8230; com/malice</a><!-- m -->. This file will get executed when it is included and it will a write a new file to the disk. This file could be a shell which would allow people to execute commands to the terminal from it as well as other things they should not bea ble to. Another thing the attacker can do is set page to<!-- m --> <a href="http://example.com/malice.php">http://example.com/malice.php</a><!-- m -->? (note the ending question mark). That will make whatever follows it part of the query string and therefore ignored by the server the file is getting included from. Why this is a security issue should be pretty obvious. People should definitely not be able to execute whatever commands they want on our server, so how can we prevent them?</p>
<p>There are a couple of php.ini directives you can use to prevent this:</p>
<p>allow_url_fopen this directive is set to on by default and it controls whether remote files should be includable.<br />
allow_url_include this directive is set to off by default and was introduced in PHP 5.2. It controls whether the include(), require(), include_once() and require_once() should be able to include remote files. In versions below PHP 5.2 this was also controlled by allow_url_fopen. Furthermore, if allow_url_fopen is set to off then this directive will be ignored and set to off as well.<br />
Basically those two directives will enable you to set the required security settings you will need. Again, no data that is not from the inside of your system should be trusted. You must validate user input and ensure that people will not enter malformed or unexpected data.</p>
<p>One of our other administrators, Thomas Johnson, has written a small tutorial about how you can use Apache to block RFI attacks called Preventing remote file include attacks with mod rewrite. You might want to check that out as well if you are concerned about RFI vulnerabilities.</p>
<p><span style="font-weight:bold;">7. Session security</span><br />
Sessions and cookies are also two things where you have to watch out. Although they cannot breach your application&#8217;s security they can be used to compromise user accounts.</p>
<p>When you are using sessions, PHP will most often store a cookie on the client computer called PHPSESSID (can be changed by you). This cookie will hold a value, a session identifier, which is associated with some sort of data on the server. If the user has a valid session ID then the data associated with the session will get into the $_SESSION super-global array. Sessions can also be transferred via the URL. In that case it would be something like ?PHPSESSID=id_here.</p>
<p>7.1. Stealing the cookies<br />
Imagine that you have a key for a vault in your bank. If you have the key then you can get whatever is in the vault. The session ID works a bit like that. However, your key for your vault can be stolen and similarly can the session ID of your users (including you) be stolen or intercepted.</p>
<p>For the record, just because I used a vault/key analogy then it does not mean that you should put secret or important data of some sort in your sessions.</p>
<p>Earlier we talked about XSS and I mentioned briefly that it could be used to steal people&#8217;s cookies. That is the most common way cookies are stolen. This cookie could be PHPSESSID (or whatever you may have renamed it to. When you steal a session ID and try to use it again it is called session fixation. So&#8230; if you can get a valid session ID and that session is used for something like authentication then you will essentially be logged in as that user. Obviously that is not a good thing &#8211; especially not if the user is high ranking with administrative privileges.</p>
<p>7.2. Issues with shared hosting<br />
Most people host their website on what is called shared hosting. It is basically when there are multiple people having their websites hosted on a single server. On a server with a Linux operating system session data will by default be stored in the /tmp directory. It is a directory that stores temporary data and it will obviously have to be readable and writable by everyone. Therefore, if your session data is stored in there, which it is by default, then the other users can find it if they look hard enough. This poses the same security issues as with cookies being stolen using XSS.</p>
<p>7.3. Preventing session fixation<br />
Now that we have talked a bit about how the session ID can be stolen then let us talk a bit about how we can minimize the risk session fixation.</p>
<p>One thing we can do is to change the session ID often. If we do that then the chance that the intercepted session ID will be valid will be greatly minimized if that ID changes often. We can use one of PHP&#8217; built-in functions called session_regenerate_id(). When we call this function the session ID will be, no surprise, regenerated. The client will simply be informed that the ID has changed via an HTTP response header called Set-Cookie.</p>
<p>If you are using PHP 5.2+ then you can tell the browser that Javascript should not be given access to the cookie using a flag called httponly. You can set this flag using the php.ini directive called session.cookie_httponly or you can use the session_set_cookie_params() function.</p>
<p>Regarding the issue with the shared hosts, the fix is simple: store the data where only you have access. You can use the directive called session.save_path to set another path for storing them. You can also store them in a database, but then you will have to write your own handler using the function called session_set_save_handler().</p>
<p><span style="font-weight:bold;">8. Cross-site request forgery</span><br />
Cross-site request forgery (CSRF) is when you trick the user into making a request they have never made. Imagine that in your application it is possible to delete users like this: /user/delete/Joe. That would delete the user with the username &#8220;Joe&#8221;. A malicious user might place this bit of HTML on his website:<br />
&lt;img src=&#8221;http://example.com/user/delete/Joe&#8221; height=&#8221;1&#8243; width=&#8221;1&#8243; /&gt;<br />
This will basically trick the user into making a request to that page without them knowing it. Obviously only people who are logged in as administrators should be able to call this URL and therefore it will fail for most users. However, if a logged in administrator goes to the page where the above piece of HTML is located then the request will be successfully completed and &#8220;Joe&#8221; will be gone.</p>
<p>How can we prevent this? Well, in this case we could simply ask the admin to verify the action with his password before performing it. Yes, I know, this is kind of like Windows Vista&#8217;s UAC (User Account Control) that people claim is incredibly annoying and prompts them to verify their action every fifth millisecond, but sometimes you will, unfortunately, have to add just a little amount of nuisance in order to keep your application safe.</p>
<p>Had the account come from a form then we could simply require that the information (in the previous case the username) be submitted using post and read it like $_POST['username']. However, this adds only a minimum of extra security. More sophisticated attacks than the above could just as easily trick the user into performing a POST request instead GET. We could use the &#8220;enter your password&#8221; method like before, but we could also use another kind of token. Imagine this form:<br />
&lt;?php<br />
session_start();<br />
$_SESSION['token'] = uniqid(md5(microtime()), true);<br />
?&gt;</p>
<p>&lt;form action=&#8221;/delete-user.php&#8221; method=&#8221;post&#8221;&gt;<br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;token&#8221; value=&#8221;&lt;?php echo<br />
$_SESSION['token'] ?&gt;&#8221; /&gt;</p>
<p>Username: &lt;input type=&#8221;text&#8221; name=&#8221;username&#8221; /&gt;<br />
&lt;button type=&#8221;submit&#8221;&gt;Delete user&lt;/button&gt;<br />
&lt;/form&gt;<br />
Here we have added a hidden field called token and stored its content in a session. On the next page we can do something like this:<br />
&lt;?php<br />
session_start();</p>
<p>if ($_POST['token'] !== $_SESSION['token']) {<br />
die(&#8216;Invalid token&#8217;);<br />
}</p>
<p>// form processing here<br />
?&gt;<br />
We simply check that it is a valid token and we have then successfully ensured that the request did in fact come from the form.</p>
<p><span style="font-weight:bold;">9. Directory traversal</span><br />
Imagine the same script we used when talking about RFI attacks:<br />
&lt;?php<br />
$page = isset($_GET['page']) ? $_GET['page'] : &#8216;home&#8217;;</p>
<p>require $page . &#8216;.php&#8217;;<br />
?&gt;<br />
We will just say that this particular file is stored in the following path: /home/someone/public_html/index.php. The attacker could then do: index.php?page=../secret</p>
<p>That would give us /home/someone/public_html/secret.php which would otherwise have been accessible. I am sure you could think of more dangerous situations than this particular one.</p>
<p>There are a couple of ways you could prevent this with. First of all you could have an array of valid pages, e.g.:<br />
$pages = array(<br />
&#8216;home&#8217;,<br />
&#8216;login&#8217;,<br />
&#8216;logout&#8217;,<br />
// etc.<br />
);</p>
<p>if (!in_array($page, $pages) {<br />
die(&#8216;Invalid page&#8217;);<br />
}<br />
Another thing you could do is check that the requested file matches a particular format:<br />
$file = str_replace(&#8216;\\&#8217;, &#8216;/&#8217;, realpath($page . &#8216;.php&#8217;));</p>
<p>if (!preg_match(&#8216;%^/home/someone/public_html/[a-z]+\.php$%&#8217;, $file)) {<br />
die(&#8216;Invalid page&#8217;);<br />
}</p>
<p>include $file;<br />
Basically you need to verify that the entered information is valid and conforms to what you expected.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeplatter123.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeplatter123.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeplatter123.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeplatter123.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codeplatter123.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codeplatter123.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codeplatter123.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codeplatter123.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeplatter123.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeplatter123.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeplatter123.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeplatter123.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeplatter123.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeplatter123.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeplatter123.wordpress.com&amp;blog=8811015&amp;post=18&amp;subd=codeplatter123&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codeplatter123.wordpress.com/2009/08/02/php-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a3029aa84cc06043d699d3a88ee8c44c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">codeplatter123</media:title>
		</media:content>
	</item>
	</channel>
</rss>
