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

<channel>
	<title>deepakkaletha.com</title>
	<atom:link href="http://deepakkaletha.com/feed" rel="self" type="application/rss+xml" />
	<link>http://deepakkaletha.com</link>
	<description></description>
	<lastBuildDate>Wed, 21 Jul 2010 10:36:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Generate a Automatic Password in php</title>
		<link>http://deepakkaletha.com/generate-a-automatic-password-in-php-34</link>
		<comments>http://deepakkaletha.com/generate-a-automatic-password-in-php-34#comments</comments>
		<pubDate>Tue, 20 Jul 2010 16:44:05 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[PHP Snippets]]></category>
		<category><![CDATA[automatic Generation of password]]></category>
		<category><![CDATA[Generate Password]]></category>

		<guid isPermaLink="false">http://deepakkaletha.com/generate-a-automatic-password-in-php-34</guid>
		<description><![CDATA[how to generate random passwords that are highly secure and extremely difficult to crack. However you can choose between various complexity/strength and you can set password length as well.Simple method or Traditional way  to generate password is using rand() function: concatenate several random-selected letters together. Something like this: &#60;?php function generate_password($len = 6){ $r = [...]]]></description>
			<content:encoded><![CDATA[<p>how to generate random passwords that are highly secure and extremely difficult to crack. However you can choose between various complexity/strength and you can set password length as well.Simple method or Traditional way  to generate password is using rand() function: concatenate several random-selected letters together. Something like this:</p>
<blockquote></blockquote>
<p><span id="more-34"></span></p>
<blockquote>
<pre>&lt;?php
function generate_password($len = 6){</pre>
<pre>    $r = '';</pre>
<pre>    for($i=0; $i&lt;$len; $i++)</pre>
<pre>        $r .= chr(rand(0, 25) + ord('a'));</pre>
<pre>    return $r;</pre>
<pre>}?&gt;</pre>
</blockquote>
<pre>Combination of rand() and md5() function is often used as a simpler alternative</pre>
<blockquote>
<pre>&lt;?phpfunction gen_md5_password($len = 6){    // function calculates 32-digit hexadecimal md5 hash    // of some random data</pre>
<pre> return substr(md5(rand().rand()), 0, $len);</pre>
<pre>}?&gt;</pre>
</blockquote>
<p>Time is important factor to generate a distinct value.The function accept two parameters, <em>$length</em>, the desired length of the password, and <em>$strength</em>, the desired strength of the password.</p>
<blockquote><p>function generatePassword($length=9, $strength=0) {<br />
$vowels = &#8216;aeuy&#8217;;<br />
$consonants = &#8216;bdghjmnpqrstvz&#8217;;<br />
if ($strength &gt;= 1) {<br />
$consonants .= &#8216;BDGHJLMNPQRSTVWXZ&#8217;;<br />
}<br />
if ($strength &gt;= 2) {<br />
$vowels .= &#8220;AEUY&#8221;;<br />
}<br />
if ($strength &gt;= 4) {<br />
$consonants .= &#8217;23456789&#8242;;<br />
}<br />
if ($strength &gt;= 8 ) {<br />
$vowels .= &#8216;@#$%&#8217;;<br />
}</p>
<p>$password = &#8221;;<br />
$alt = time() % 2;<br />
for ($i = 0; $i &lt; $length; $i++) {<br />
if ($alt == 1) {<br />
$password .= $consonants[(rand() % strlen($consonants))];<br />
$alt = 0;<br />
} else {<br />
$password .= $vowels[(rand() % strlen($vowels))];<br />
$alt = 1;<br />
}<br />
}<br />
return $password;<br />
}</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://deepakkaletha.com/generate-a-automatic-password-in-php-34/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Visual Cheat Sheet, the refined and updated version of the popular jQuery Cheat Sheet is finally here. The new edition includes all the reference you will ever need for jQuery 1.4.2 API!</title>
		<link>http://deepakkaletha.com/jquery-visual-cheat-sheet-the-refined-and-updated-version-of-the-popular-jquery-cheat-sheet-is-finally-here-the-new-edition-includes-all-the-reference-you-will-ever-need-for-jquery-1-4-2-api-30</link>
		<comments>http://deepakkaletha.com/jquery-visual-cheat-sheet-the-refined-and-updated-version-of-the-popular-jquery-cheat-sheet-is-finally-here-the-new-edition-includes-all-the-reference-you-will-ever-need-for-jquery-1-4-2-api-30#comments</comments>
		<pubDate>Fri, 25 Jun 2010 02:48:56 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery Cheat sheat]]></category>

		<guid isPermaLink="false">http://deepakkaletha.com/?p=30</guid>
		<description><![CDATA[This cheat sheet (6 pages) contains the full jQuery API reference with detailed descriptions and some sample code. The simple visual style I used to design this sheet allows you to find at a glance everything you are looking for&#8230;. &#62;&#62;Download jQuery cheat sheet in pdf]]></description>
			<content:encoded><![CDATA[<p>This cheat sheet (6 pages) contains the full jQuery API reference with detailed descriptions and some sample code. The simple visual style I used to design this sheet allows you to find at a glance everything you are looking for&#8230;.<br />
<a href="http://deepakkaletha.com/cheatsheet/jQuery-Visual-Cheat-Sheet-1.4.2.pdf" target="_blank">&gt;&gt;Download jQuery cheat sheet in pdf </a></p>
]]></content:encoded>
			<wfw:commentRss>http://deepakkaletha.com/jquery-visual-cheat-sheet-the-refined-and-updated-version-of-the-popular-jquery-cheat-sheet-is-finally-here-the-new-edition-includes-all-the-reference-you-will-ever-need-for-jquery-1-4-2-api-30/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS3 Transitions Property Tricks</title>
		<link>http://deepakkaletha.com/css3-transitions-property-tricks-27</link>
		<comments>http://deepakkaletha.com/css3-transitions-property-tricks-27#comments</comments>
		<pubDate>Thu, 27 May 2010 02:35:42 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Css Tricks]]></category>
		<category><![CDATA[CSS3 Transitions Property]]></category>
		<category><![CDATA[Transform Rotate]]></category>
		<category><![CDATA[Transform timming Function]]></category>
		<category><![CDATA[Transition-Duration]]></category>

		<guid isPermaLink="false">http://deepakkaletha.com/css3-transitions-property-tricks-27</guid>
		<description><![CDATA[CSS3 Transitions which describe how CSS properties can be made to change smoothly from one value to another over a given duration. The property values for transitions Transitions have four values to declare at maximum: Shorthand: -webkit-transition: property_name duration timing_function delay; -moz-transition: property_name duration timing_function delay; -o-transition: property_name duration timing_function delay; transition: property_name duration timing_function [...]]]></description>
			<content:encoded><![CDATA[<p>CSS3 Transitions which describe how CSS properties can be made to change smoothly from one value to another over a given duration. The property values for transitions Transitions have four values to declare at maximum:</p>
<p> <span id="more-27"></span>
</p>
<p><font size="2">Shorthand:</font> </p>
<blockquote><p>-webkit-transition: property_name duration timing_function delay;</p>
<p>-moz-transition: property_name duration timing_function delay;</p>
<p>-o-transition: property_name duration timing_function delay;</p>
<p>transition: property_name duration timing_function delay; </p>
</blockquote>
<p> <font size="2">(Target) Property:</font><br />
<blockquote>
<p>-webkit-transition-property: property_name; </p>
<p>-moz-transition-property: property_name;</p>
<p>-o-transition-property: property_name; </p>
<p>transition-property: property_name; </p>
</blockquote>
<p><font size="2">Duration:</font></p>
<blockquote><p>-webkit-transition-duration: duration;&#160; </p>
<p>-moz-transition-duration: duration;&#160; </p>
<p>-o-transition-duration: duration;&#160; </p>
<p>transition-duration: duration; </p>
</blockquote>
<p><font size="2">Timing (of motion):</font></p>
<blockquote><p>-webkit-transition-timing-function: timing_function;&#160; </p>
<p>-moz-transition-timing-function: timing_function;&#160; </p>
<p>-o-transition-timing-function: timing_function;&#160; </p>
<p>transition-timing-function: timing_function;</p>
</blockquote>
<p><font size="2">Available timing functions:</font></p>
<blockquote><p><i>ease</i> – equivalent to cubic-bezier(0.25, 0.1, 0.25, 1.0). </p>
<p><i>linear</i> – equivalent to cubic-bezier(0.0, 0.0, 1.0, 1.0). </p>
<p><i>ease-in</i> – equivalent to cubic-bezier(0.42, 0, 1.0, 1.0). </p>
<p><i>ease-out</i> – equivalent to cubic-bezier(0, 0, 0.58, 1.0). </p>
<p><i>ease-in-out</i> – equivalent to cubic-bezier(0.42, 0, 0.58, 1.0). </p>
</blockquote>
<p><font size="2">Delay:</font></p>
<blockquote><p>-webkit-transition-delay: delay;&#160; </p>
<p>-moz-transition-delay: delay;&#160; </p>
<p>-o-transition-delay: delay;&#160; </p>
<p>-transition-delay: delay;&#160; </p>
</blockquote>
<p>Delay (like duration) can be entered either in seconds (eg. <i>0.7s</i>) or in milliseconds (eg. 7<i>00ms</i>).</p>
<p>In general, it’s good to declare transitions on default state selectors without pseudo classes. This will cause transition played in both direction, eg. when hovering.</p>
<p>Remember, you have to enter all the properties four times before being cross-browser compliant. Therefore it’d be best to use shorthand codes for keeping your CSS code clean. </p>
]]></content:encoded>
			<wfw:commentRss>http://deepakkaletha.com/css3-transitions-property-tricks-27/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>widows Attribute &amp; Property &#124; orphans Attribute &amp; Property</title>
		<link>http://deepakkaletha.com/widows-attribute-property-orphans-attribute-property-26</link>
		<comments>http://deepakkaletha.com/widows-attribute-property-orphans-attribute-property-26#comments</comments>
		<pubDate>Mon, 10 May 2010 06:43:14 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Css Tricks]]></category>
		<category><![CDATA[orphans Attribute]]></category>
		<category><![CDATA[orphans Property]]></category>
		<category><![CDATA[widows Attribute]]></category>
		<category><![CDATA[widows Property]]></category>

		<guid isPermaLink="false">http://deepakkaletha.com/widows-attribute-property-orphans-attribute-property-26</guid>
		<description><![CDATA[Precise widow and orphan control is also available through the widows&#160; and orphans properties. The value of the property is the minimum number of lines which is allowed to be widowed or orphaned. For example you can prevent less than four lines of a paragraph being left behind or printed on a new page using [...]]]></description>
			<content:encoded><![CDATA[<p>Precise widow and orphan control is also available through the widows&#160; and orphans properties. The value of the property is the minimum number of lines which is allowed to be widowed or orphaned. </p>
<p> <span id="more-26"></span>
<p>For example you can prevent less than four lines of a paragraph being left behind or printed on a new page using the following:</p>
<p>p {&#160; widows:4;    <br />&#160;&#160;&#160;&#160;&#160; orphans:4; }</p>
<h2 id="tit">widows Attribute &amp; Property </h2>
<p>Sets or retrieves the minimum number of lines of a paragraph that must appear at the top of a page. </p>
<p><strong>Syntax</strong></p>
<blockquote><p><strong>HTML</strong>       <br />{ widows : nLines } </p>
<p><strong>Scripting</strong>       <br />[ nLines<strong> =</strong> ] <em>object</em>.<strong>style.widows</strong> [ = <em>nLines</em> ]</p>
</blockquote>
<p>** The property has no default value. The Cascading Style Sheets (CSS) attribute is not inherited.</p>
<p>This property applies when the document is printed. If there are fewer lines than necessary to satisfy this rule, the lines are moved to the following page. The <strong>widows</strong> property has precedence over the orphans property. </p>
<p>This property requires Internet Explorer to be in IE8 mode rendering. </p>
<h2 id="tit">Orphans Attribute &amp; Property </h2>
<p>Sets or retrieves the minimum number of lines of a paragraph that must appear at the bottom of a page. </p>
<p><strong>Syntax</strong></p>
<blockquote><p><strong>HTML</strong>      <br />{ orphans : nLines } </p>
<p><strong>Scripting</strong>      <br />[ nLines<strong> =</strong> ] <em>object</em>.<strong>style.orphans</strong> [ = <em>nLines</em> ]</p>
</blockquote>
<p> ** The property has a default value of 0. The Cascading Style Sheets (CSS) attribute is not inherited.  </p>
]]></content:encoded>
			<wfw:commentRss>http://deepakkaletha.com/widows-attribute-property-orphans-attribute-property-26/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Fixed, Fluid, Elastic Layout</title>
		<link>http://deepakkaletha.com/fixed-fluid-elastic-layout-22</link>
		<comments>http://deepakkaletha.com/fixed-fluid-elastic-layout-22#comments</comments>
		<pubDate>Mon, 10 May 2010 05:36:45 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Css Tricks]]></category>
		<category><![CDATA[% examples]]></category>
		<category><![CDATA[Elastic Layout]]></category>
		<category><![CDATA[em]]></category>
		<category><![CDATA[Fixed]]></category>
		<category><![CDATA[Fluid]]></category>
		<category><![CDATA[px]]></category>

		<guid isPermaLink="false">http://deepakkaletha.com/fixed-fluid-elastic-layout-22</guid>
		<description><![CDATA[Fixed, Fluid, Elastic or a hybrid layout design &#8211; Each option has its own benefits and disadvantages. But the final decision depends so much on usability that it is not one to be made lightly. In CSS the width of a box is set using the width property with any unit of length, for example: [...]]]></description>
			<content:encoded><![CDATA[<p>Fixed, Fluid, Elastic or a hybrid layout design &#8211; Each option has its own benefits and disadvantages. But the final decision depends so much on usability that it is not one to be made lightly. </p>
<p> <span id="more-22"></span>
<p>In CSS the width of a box is set using the width property with any unit of length, for example:    <br />DIV#col1 {     <br />&#160; width:400px } </p>
<p>DIV#col2 {    <br />&#160; width:50% } </p>
<p>DIV#col3 {    <br />&#160; width:33em }</p>
<p>&#160;</p>
<h2 id="tit">Fixed Layout</h2>
<div style="margin-top: 10px; width: 400px; background-color: rgb(96,104,112)">column 1 has a fixed width: it has been set to 400 px wide. With text rendering at 12 px this would result in a measure of approximately 66 characters per line. If your reader increases the text size to 16 px then the measure reduces to 50 characters per line. Thus when the text size is changed, so the measure changes.    </div>
<p>A fixed width site is one where the main wrapper is set to a specific immovable width independent of the user agent’s display resolution. A common and considerate fixed width is 760 pixels, a size that ensures users with 800×600 resolution monitors have close to full window viewing without annoying side-scrolling.    </p>
<p>This fixed-width div is 400 pixels wide. This example cannot be resized due to its fixed width. If the text is enlarged, it’ll wrap. </p>
<h2 id="tit">Fluid Layout</h2>
<div style="margin-top: 10px; width: 50%; background-color: rgb(96,104,112)">Column 2 has a liquid width: it has been set to 50% wide. Assuming your reader is browsing with a window 1000 px wide, the box would be rendered as 500 px wide, resulting in a measure of about 83 characters per line. A measure of 83 may be a little too wide for your reader, but because the box is liquid, your reader could reduce their window size to 800 px, thus narrowing the box to 400 px and creating a more comfortable measure of 66 characters per line.    </div>
<p>A fluid or liquid layout is created by not specifying a wrapper width at all or doing so using the percentage unit of measure. In other words, barring borders and padding screwing things up, a 100% width site will take up the entire view port width without producing a horizontal scroll bar.<br \><br \> This fluid-width div is 74% of the container’s fixed width. This example cannot be resized due to its fixed width parent. Changing screen size will have no bearing and if the text is enlarged, it’ll wrap.</p>
<h2 id="tit">Elastic Layout</h2>
<div style="margin-top: 10px; width: 33em; background-color: rgb(96,104,112)">Column 3 has an elastic width: it has been set to 33 em wide. On average one character takes up 0.5 em so this box will have a measure of 66 characters per line. If your reader increases the text size, the width of box will increase accordingly and so the measure remains at 66 regardless of the text size.</div>
<p>An elastic site’s main wrapper and other elements are measured using <em>ems</em> as the unit of measure. Ems are relative proportionally to the text or font size. Thus, as the text size is increased, the sections measured in ems will increase in size as well.</p>
<p>&#160;</p>
<p>This elastic-width <code>div</code> is 35ems wide. This example will change width as the text is enlarged, but this example has no width limiter.</p>
]]></content:encoded>
			<wfw:commentRss>http://deepakkaletha.com/fixed-fluid-elastic-layout-22/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Cheat Sheet</title>
		<link>http://deepakkaletha.com/css-cheat-sheet-18</link>
		<comments>http://deepakkaletha.com/css-cheat-sheet-18#comments</comments>
		<pubDate>Thu, 06 May 2010 02:39:46 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Css Tricks]]></category>
		<category><![CDATA[Box Shadow]]></category>
		<category><![CDATA[Column Layout]]></category>
		<category><![CDATA[CSS Cheat Sheet]]></category>
		<category><![CDATA[download cheat sheet]]></category>
		<category><![CDATA[rounded coner]]></category>
		<category><![CDATA[Transform Rotate]]></category>

		<guid isPermaLink="false">http://deepakkaletha.com/css-cheat-sheet-18</guid>
		<description><![CDATA[The CSS cheat sheet is designed to act as a reminder and reference sheet, listing all selectors (as of CSS 3) and properties. It includes a visual example of the box model, unit reference for CSS units and the various media types CSS makes allowance for. A description of what is on the cheat sheet [...]]]></description>
			<content:encoded><![CDATA[<p>The CSS cheat sheet is designed to act as a reminder and reference sheet, listing all selectors (as of CSS 3) and properties.</p>
<p> <span id="more-18"></span>
<p>It includes a visual example of the box model, unit reference for CSS units and the various media types CSS makes allowance for. A description of what is on the cheat sheet follows, or if you are impatient, you can go straight to the full size CSS cheat sheet</p>
<p><a href="http://deepakkaletha.com/cheatsheet/css.pdf" target="_blank">&gt;&gt;Download css cheat sheet in pdf 120.kb</a></p>
<div style="background-color: #606870; margin-top: 10px; width: 150px">Rounded Corners</div>
<p> Mozilla/Firefox and Safari 3 users should see a nicely rounded box, with a nicely rounded border.
<div id="Snippets">width: 300px;    <br />background-color: #cccccc;     <br />border: 1px solid #999999;     <br />border-radius: 5px;     <br />-moz-border-radius: 5px;     <br />-webkit-border-radius: 5px;     <br />-khtml-border-radius: 5px;     <br />padding: 15px 15px 15px 15px;     </div>
<div style="background-color: #606870; margin-top: 10px; width: 150px">Box Shadows</div>
<p> Object shadows work with Firefox, Safari and Chrome. Here is a great tutorial with many more examples for box shadows. There are also several workarounds for Internet Explorer.
<div id="Snippets">width: 300px; background-color: #cccccc;    <br />border: 1px solid #999999;     <br />box-shadow: 3px 3px 3px #aaaaaa;     <br />-moz-box-shadow: 3px 3px 3px #aaaaaa;     <br />-webkit-box-shadow: 3px 3px 3px #aaaaaa;     <br />padding: 15px 15px 15px 15px;     </div>
<div style="background-color: #606870; margin-top: 10px; width: 150px">Transform Rotate</div>
<p> CSS transforms work with Firefox, Safari and Chrome. For IE, it is possible to add similar effects via matrix filters.
<div id="Snippets">margin: 50px 0 50px 0;    <br />width: 200px;     <br />transform: rotate(30deg);     <br />-moz-transform: rotate(30deg);     <br />-webkit-transform: rotate(30deg);     </div>
<div style="background-color: #606870; margin-top: 10px; width: 150px">Column Layout</div>
<p> Column Layout is supported in Safari and Firefox. This degrades gracefully on other browsers by reverting to a standard one column layout.
<div id="Snippets">width: 600px;    <br />padding: 15px 15px 15px 15px;     <br />-webkit-column-count: 2;     <br />-webkit-column-gap: 30px;     <br />-moz-column-count: 2;     <br />-moz-column-gap: 30px;     </div>
<p><a href="http://deepakkaletha.com/cheatsheet/css.pdf" target="_blank">&gt;&gt;Download css cheat sheet in pdf 120.kb</a></p>
]]></content:encoded>
			<wfw:commentRss>http://deepakkaletha.com/css-cheat-sheet-18/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Displaying XML Content in PHP</title>
		<link>http://deepakkaletha.com/displaying-xml-content-in-php-17</link>
		<comments>http://deepakkaletha.com/displaying-xml-content-in-php-17#comments</comments>
		<pubDate>Wed, 05 May 2010 03:33:59 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[PHP Snippets]]></category>
		<category><![CDATA[Displaying XML Content]]></category>
		<category><![CDATA[read xml file]]></category>
		<category><![CDATA[xml in PHP]]></category>

		<guid isPermaLink="false">http://deepakkaletha.com/displaying-xml-content-in-php-17</guid>
		<description><![CDATA[The easiest way to deal with XML content in PHP is to use the Simple XML functions of PHP. Using these, we can turn a bunch of XML into a PHP object and loop over it. &#60;?php $url = &#8216;http://rss1.deepakkaletha.com/feed/&#8217;; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); curl_close($ch); $data = [...]]]></description>
			<content:encoded><![CDATA[<p>The easiest way to deal with XML content in PHP is to use the <a href="http://php.net/manual/en/book.simplexml.php">Simple XML functions of PHP</a>. Using these, we can turn a bunch of XML into a PHP object and loop over it.</p>
<p> <span id="more-17"></span>
<div id="Snippets">&lt;?php    <br />$url = &#8216;http://rss1.deepakkaletha.com/feed/&#8217;;     <br />$ch = curl_init();     <br />curl_setopt($ch, CURLOPT_URL, $url);     <br />curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);     <br />$output = curl_exec($ch);     <br />curl_close($ch);     <br />$data = simplexml_load_string($output);     <br />echo &#8216;&lt;ul&gt;&#8217;;     <br />foreach($data-&gt;entry as $e){     <br />echo &#8216;&lt;li&gt;&lt;a href=&quot;&#8217; . $e-&gt;link[0]['href'] .     <br />&#8216;&quot;&gt;&#8217;.$e-&gt;title.&#8217;&lt;/a&gt;&lt;/li&gt;&#8217;;     <br />}     <br />echo &#8216;&lt;/ul&gt;&#8217;;     <br />?&gt; </div>
<p>The <code>simplexml_load_string()</code> function turns the XML document into a PHP object with arrays. How did I figure out to loop over <code>data-&gt;entry</code> and get the <code>href</code> via <code>link[0]['href']</code>? Simple. I did a <code>print_r($output)</code> and checked the source of the document by hitting <em>Cmd + U</em> in Firefox on my Mac. That showed me that this <code>entry</code> is an array. I then did a <code>print_r($e)</code> in the loop to see all the properties of every entry. If it is part of the <code>@attributes</code> array, then you need to use the <code>[]</code> notation.</p>
]]></content:encoded>
			<wfw:commentRss>http://deepakkaletha.com/displaying-xml-content-in-php-17/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Send Email from a PHP Script</title>
		<link>http://deepakkaletha.com/how-to-send-email-from-a-php-script-11</link>
		<comments>http://deepakkaletha.com/how-to-send-email-from-a-php-script-11#comments</comments>
		<pubDate>Sun, 02 May 2010 04:25:00 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[PHP Snippets]]></category>
		<category><![CDATA[email script]]></category>
		<category><![CDATA[email Snippets]]></category>
		<category><![CDATA[php email script]]></category>
		<category><![CDATA[Send Email]]></category>

		<guid isPermaLink="false">http://deepakkaletha.com/?p=11</guid>
		<description><![CDATA[The first thing we need to do is to write the contact form itself. Put the following code in the &#60;body&#62; section of an HTML file named, say, contact.html. &#60;form method=&#34;post&#34; action=&#34;mail.php&#34;&#62; &#60;b&#62;Email&#60;/b&#62; &#60;input name=&#34;email&#34; /&#62; &#60;p&#62;&#60;b&#62;Subject&#60;/b&#62; &#60;input name=&#34;subject&#34; /&#62; &#60;/p&#62; &#60;p&#62;&#60;b&#62;Message&#60;/b&#62; &#60;textarea name=&#34;message&#34;&#62;&#60;/textarea&#62; &#60;/p&#62; &#60;p&#62;&#60;input type=&#34;submit&#34; /&#62; &#60;/p&#62; Now all that remains is to [...]]]></description>
			<content:encoded><![CDATA[<p>The first thing we need to do is to write the contact form itself. Put the following code in the &lt;body&gt; section of an HTML file named, say, contact.html.</p>
<p> <span id="more-11"></span>
<div id="Snippets">
<p>&lt;form method=&quot;post&quot; action=&quot;mail.php&quot;&gt;      <br />&lt;b&gt;Email&lt;/b&gt; &lt;input name=&quot;email&quot; /&gt;       <br />&lt;p&gt;&lt;b&gt;Subject&lt;/b&gt; &lt;input name=&quot;subject&quot; /&gt; &lt;/p&gt;       <br />&lt;p&gt;&lt;b&gt;Message&lt;/b&gt; &lt;textarea name=&quot;message&quot;&gt;&lt;/textarea&gt; &lt;/p&gt;       <br />&lt;p&gt;&lt;input type=&quot;submit&quot; /&gt; &lt;/p&gt; </p>
</p></div>
<p>Now all that remains is to code &quot;mail.php&quot;. This is made extremely easy by the facilities available in PHP. Type the following code into a file named &quot;mail.php&quot;. Do not put anything else into that file, ie, don&#8217;t put in any other HTML tags or headers, etc</p>
<div id="Snippets">if (isset($_REQUEST['email']))    <br />{//if &quot;email&quot; is filled out, proceed     <br />//check if the email address is invalid     <br />$mailcheck = spamcheck($_REQUEST['email']);     <br />if ($mailcheck==FALSE)     <br />{     <br />echo &#8216;&lt;div style=&quot;background-color:#ffa; padding:20px&quot;&gt; Invalid Input&lt;/div&gt;&#8217;;     <br />}     <br />else     <br />{//send email     <br />$name = $_REQUEST['name'];     <br />$email = $_REQUEST['email'] ;     <br />$subject = &quot;Enquiry from the Website&quot;;     <br />$message = $_REQUEST['message'].&quot;\n**************************************\n Name &#8211; $name \n Email &#8211; $email &quot;;     <br />mail(&quot;example@gmail.com&quot;, &quot;Subject: $subject&quot;,$message );     <br />echo &#8216;&lt;div style=&quot;background-color:#ffa; padding:20px&quot;&gt; Message Sent Succesfully , We Will get Back to You Soon ! &lt;/div&gt;&#8217;;     <br />//echo &quot; $email &#8212; $subject &#8212; $message&quot;;     <br />}     <br />} </div>
<p>When the form is submitted to mail.php, the contents of the &quot;email&quot; field in the form is put into a PHP variable called $_REQUEST['email']. Likewise the contents of the &quot;message&quot; field is put into the variable $_REQUEST['message']. </p>
<p>If you had named the fields in your form &quot;emailofsender&quot; and &quot;contentsofmessage&quot;, then the information submitted in those fields would have been available to your script in the variables $_REQUEST['emailofsender'] and $_REQUEST['contentsofmessage'] respectively. I think you get the idea. </p>
<p>The first thing we do in our PHP script is to make the information that is submitted easily accessible to the rest of the program. </p>
<p>Firstly, we made a copy of the contents of $_REQUEST['email'] in a variable we call $email. This was done in the line </p>
<p>&#160;</p>
<div style="backgroundcolor: #606870">$email = $_REQUEST['email'] ; </div>
<div style="backgroundcolor: #606870">&#160;</div>
<p>Note that we don&#8217;t really have to call this new variable $email &#8211; we could have called it $thingamajig if we wished, but it makes sense to name a variable with some meaningful name. </p>
<p>Likewise, in the next line, we made a copy (assigned) of $_REQUEST['message'] in a variable $message. </p>
<p>&#160;</p>
<div style="backgroundcolor: #606870">$message = $_REQUEST['message'] ;</div>
<div style="backgroundcolor: #606870">&#160;</div>
<p>Again, we could have named the new variable anything we wanted &#8211; but it&#8217;s easier for us to understand the program if the variable name reflects what it does. </p>
<p>The real workhorse of this script is in the line beginning with &quot;mail&quot;</p>
<p>&#160;</p>
<div style="backgroundcolor: #606870">mail(&quot;example@gmail.com&quot;, &quot;Subject: $subject&quot;,$message ); </div>
]]></content:encoded>
			<wfw:commentRss>http://deepakkaletha.com/how-to-send-email-from-a-php-script-11/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
