<?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>Webburners &#187; php</title>
	<atom:link href="http://www.webburners.com/category/tutorial/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webburners.com</link>
	<description>We Burn the web with our expertise</description>
	<lastBuildDate>Thu, 08 Apr 2010 12:53:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to use post and get method in ajax</title>
		<link>http://www.webburners.com/2009/04/how-to-use-post-and-get-method-in-ajax/</link>
		<comments>http://www.webburners.com/2009/04/how-to-use-post-and-get-method-in-ajax/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 14:57:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[ajax post method]]></category>
		<category><![CDATA[ajax using get and post method]]></category>

		<guid isPermaLink="false">http://www.webburners.com/?p=289</guid>
		<description><![CDATA[Using GET method
Now we open a connection using the GET method.

var url = "get_data.php";
var params = "lorem=ipsum&#38;name=binny";
http.open("GET", url+"?"+params, true);
http.onreadystatechange = function() {//Call a function when the state changes.
	if(http.readyState == 4 &#38;&#38; http.status == 200) {
		alert(http.responseText);
	}
}
http.send(null);

I really hope that this much is clear for you &#8211; I am assuming that you know a bit of Ajax [...]]]></description>
			<content:encoded><![CDATA[<h3>Using GET method</h3>
<p>Now we open a connection using the GET method.</p>
<pre><code class="javascript">
var url = "get_data.php";
var params = "lorem=ipsum&amp;name=binny";
http.open("<span class="special">GET</span>", url<span class="special">+"?"+params</span>, true);
http.onreadystatechange = function() {//Call a function when the state changes.
	if(http.readyState == 4 &amp;&amp; http.status == 200) {
		alert(http.responseText);
	}
}
http.send(<span class="special">null</span>);
</code></pre>
<p>I really hope that this much is clear for you &#8211; I am assuming that you know a bit of Ajax coding. If you don&#8217;t, please read a <a title="A Gentle Introduction to Ajax" href="http://www.openjs.com/ajax/tutorial/">ajax tutorial</a> that explains these parts before continuing.</p>
<h3>POST method</h3>
<p>We are going to make some modifications so POST method will be used when sending the request&#8230;</p>
<pre><code class="javascript">
var url = "get_data.php";
var params = "lorem=ipsum&amp;name=binny";
http.open("<span class="highlight">POST</span>", url, true);

<span class="highlight">//Send the proper header information along with the request
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");</span>

http.onreadystatechange = function() {//Call a function when the state changes.
	if(http.readyState == 4 &amp;&amp; http.status == 200) {
		alert(http.responseText);
	}
}
http.send(<span class="highlight">params</span>);
</code></pre>
<p>The first change(and the most obvious one) is that I changed the first argument of the <code>open</code> function from GET to POST. Also notice the difference in the second argument &#8211; in the GET method, we send the parameters along with the url separated by a &#8216;?&#8217; character&#8230;</p>
<pre><code class="javascript">http.open("GET",<span class="special">url+"?"+params</span>, true);</code></pre>
<p>But in the POST method we will use just the url as the second argument. We will send the parameters later.</p>
<pre><code class="javascript">http.open("POST", <span class="special">url</span>, true);</code></pre>
<p>Some <a title="HTTP/1.1: Header Field Definitions" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">http headers</a> must be set along with any POST request. So we set them in these lines&#8230;</p>
<pre><code class="javascript">http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");</code></pre>
<p>With the above lines we are basically saying that the data send is in the format of a form submission. We also give the length of the parameters we are sending.</p>
<pre><code class="javascript">http.onreadystatechange = function() {//Call a function when the state changes.
	if(http.readyState == 4 &amp;&amp; http.status == 200) {
		alert(http.responseText);
	}
}</code></pre>
<p>We set a handler for the &#8216;ready state&#8217; change event. This is the same handler we used for the GET method. You can use the <code>http.responseText</code> here &#8211; insert into a div using innerHTML(<a class="mypoges blog" title="AHAH(Asynchronous HTML over HTTP) - AJAX 2.0" href="http://binnyva.blogspot.com/2005/11/ahahasynchronous-html-over-http-ajax.html">AHAH</a>), eval it(<a class="blog mypages" title="Ajax Response Data Formats" href="http://binnyva.blogspot.com/2006/03/ajax-response-data-formats.html">JSON</a>) or anything else.</p>
<pre><code class="javascript">http.send(<span class="highlight">params</span>);</code></pre>
<p>Finally, we send the parameters with the request. The given url is loaded only after this line is called. In the GET method, the parameter will be a null value. But in the POST method, the data to be send will be send as the argument of the <code>send</code> function. The <code>params</code> variable was declared in the second line as &#8220;lorem=ipsum&amp;name=binny&#8221; &#8211; so we send two parameters &#8211; &#8216;lorem&#8217; and &#8216;name&#8217; with the values &#8216;ipsum&#8217; and &#8216;binny&#8217; respectively.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webburners.com/2009/04/how-to-use-post-and-get-method-in-ajax/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to create rss using php &#8211; some easy steps</title>
		<link>http://www.webburners.com/2009/04/how-to-create-rss-using-php-some-easy-steps/</link>
		<comments>http://www.webburners.com/2009/04/how-to-create-rss-using-php-some-easy-steps/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 06:37:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.webburners.com/?p=284</guid>
		<description><![CDATA[Step 1: Find your content.
An RSS feed should probably list all the content items in your main section. For example, if you run a blog, you can have an RSS feed of all your latest posts.  If you run a small download site, consider a feed of your latest releases. Whatever content you choose, make [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Step 1: Find your content.</strong><br />
An RSS feed should probably list all the content items in your main section. For example, if you run a blog, you can have an RSS feed of all your latest posts.  If you run a small download site, consider a feed of your latest releases. Whatever content you choose, make sure it’s interesting, and will be updated regularly &#8211; aim for between 3-6 times a week, if you have a choice. Then just write out your basic database logic and get the data into an array. I’ll use $items for this example.</p>
<p><strong>Step 2: Get your basic RSS structure.</strong><br />
RSS is an XML-based format, so all you really need is a set of XML tags as part of the RSS specification. RSS provides a number of optional tags, and being XML, it can be (and often is) extended with any other tag. <a href="http://dublincore.org/" target="_blank"></a> You can borrow the basic structure from any feed,  (load it up and right click &gt; view source), but here’s a sample you can use:</p>
<blockquote>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;rss version="2.0"&gt;
&lt;channel&gt;
  &lt;title&gt;My Blog Name&lt;/title&gt;
  &lt;link&gt;http://example.com/blog&lt;/link&gt;
  &lt;description&gt;Keeping webmasters up-to-date on technology.&lt;/description&gt;
  &lt;pubDate&gt;Tue, 15 Apr 2008 18:00:00 +0000&lt;/pubDate&gt;
  &lt;item&gt;
    &lt;title&gt;Story Title&lt;/title&gt;
    &lt;pubDate&gt;Tue, 15 Apr 2008 18:00:00 +0000&lt;/pubDate&gt;
    &lt;link&gt;http://example.com/my/story&lt;/link&gt;
    &lt;description&gt;Today I saw a whale!&lt;/description&gt;
  &lt;/item&gt;
&lt;/channel&gt;
&lt;/rss&gt;</pre>
</blockquote>
<p>The easiest way to build your RSS feed in PHP is to leave all of that XML as plain text and only loop over the sections as needed (the &lt;item&gt; tags). The one gotcha here, as you’ve probably noticed, is the opening &lt;?xml tag. This will probably clash with PHP, so instead echo that line out:</p>
<blockquote>
<pre>&lt;?php echo "&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;"; ?&gt;</pre>
</blockquote>
<p>Then your structure is all in place. The <code>item</code> element is repeated for each story we have in our RSS feed; the date is RFC 2822 formatted (just use <code>date("r")</code>). We’ll use a simple <code>foreach</code> loop to put the content in:</p>
<blockquote>
<pre>&lt;?php foreach ($items as $item) { ?&gt;
  &lt;item&gt;
    &lt;title&gt;&lt;?=$item['title']?&gt;&lt;/title&gt;
    &lt;pubDate&gt;&lt;?=date("r",$item['time'])?&gt;&lt;/pubDate&gt;
    &lt;link&gt;&lt;?=$item['url']?&gt;&lt;/link&gt;
    &lt;description&gt;&lt;?=$item['description']?&gt;&lt;/description&gt;
  &lt;/item&gt;
&lt;?php } ?&gt;</pre>
</blockquote>
<p><strong>3. Serve it up!</strong><br />
To be recognised as an RSS feed, you’ll need to serve it as the right content type. Technically you should use application/rss+xml, but most browsers won’t recognise this. I find application/xhtml+xml works well, as does text/xml. The choice is yours, although IE7 seems to like text/xml better.</p>
<blockquote>
<pre>&lt;?php header("Content-type: text/xml"); ?&gt;</pre>
</blockquote>
<p><strong>And we’re done!</strong></p>
<p>Here’s a sample of the final product:</p>
<blockquote>
<pre>&lt;?php header("Content-type: text/xml"); ?&gt;
&lt;?php echo "&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;"; ?&gt;
&lt;rss version="2.0"&gt;
&lt;channel&gt;
  &lt;title&gt;My Blog Name&lt;/title&gt;
  &lt;link&gt;http://example.com/blog&lt;/link&gt;
  &lt;description&gt;Keeping webmasters up-to-date on technology.&lt;/description&gt;
  &lt;pubDate&gt;Tue, 15 Apr 2008 18:00:00 +0000&lt;/pubDate&gt;
&lt;?php foreach ($items as $item) { ?&gt;
  &lt;item&gt;
    &lt;title&gt;&lt;?=$item['title']?&gt;&lt;/title&gt;
    &lt;pubDate&gt;&lt;?=date("r",$item['time'])?&gt;&lt;/pubDate&gt;
    &lt;link&gt;&lt;?=$item['url']?&gt;&lt;/link&gt;
    &lt;description&gt;&lt;?=$item['description']?&gt;&lt;/description&gt;
  &lt;/item&gt;
&lt;?php } ?&gt;
&lt;/channel&gt;
&lt;/rss&gt;</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.webburners.com/2009/04/how-to-create-rss-using-php-some-easy-steps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parse Xml using jquery</title>
		<link>http://www.webburners.com/2009/04/parse-xml-using-jquery/</link>
		<comments>http://www.webburners.com/2009/04/parse-xml-using-jquery/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 06:20:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[xml parsing using jquery]]></category>

		<guid isPermaLink="false">http://www.webburners.com/?p=281</guid>
		<description><![CDATA[Suppose we have a file name xml file as below
&#60;?xml version=&#8220;1.0&#8243; encoding=&#8220;utf-8&#8243; ?&#62;

&#60;RecentTutorials&#62;
&#60;Tutorial author=&#8220;The Reddest&#8221;&#62;
&#60;Title&#62;Silverlight and the Netflix API&#60;/Title&#62;
&#60;Categories&#62;
&#60;Category&#62;Tutorials&#60;/Category&#62;
&#60;Category&#62;Silverlight 2.0&#60;/Category&#62;
&#60;Category&#62;Silverlight&#60;/Category&#62;
&#60;Category&#62;C#&#60;/Category&#62;
&#60;Category&#62;XAML&#60;/Category&#62;
&#60;/Categories&#62;
&#60;Date&#62;1/13/2009&#60;/Date&#62;
&#60;/Tutorial&#62;
&#60;Tutorial author=&#8220;The Hairiest&#8221;&#62;
&#60;Title&#62;Cake PHP 4 &#8211; Saving and Validating Data&#60;/Title&#62;
&#60;Categories&#62;
&#60;Category&#62;Tutorials&#60;/Category&#62;
&#60;Category&#62;CakePHP&#60;/Category&#62;
&#60;Category&#62;PHP&#60;/Category&#62;
&#60;/Categories&#62;
&#60;Date&#62;1/12/2009&#60;/Date&#62;
&#60;/Tutorial&#62;
&#60;Tutorial author=&#8220;The Tallest&#8221;&#62;
&#60;Title&#62;Silverlight 2 &#8211; Using initParams&#60;/Title&#62;
&#60;Categories&#62;
&#60;Category&#62;Tutorials&#60;/Category&#62;
&#60;Category&#62;Silverlight 2.0&#60;/Category&#62;
&#60;Category&#62;Silverlight&#60;/Category&#62;
&#60;Category&#62;C#&#60;/Category&#62;
&#60;Category&#62;HTML&#60;/Category&#62;
&#60;/Categories&#62;
&#60;Date&#62;1/6/2009&#60;/Date&#62;
&#60;/Tutorial&#62;
&#60;Tutorial author=&#8220;The Fattest&#8221;&#62;
&#60;Title&#62;Controlling iTunes with AutoHotkey&#60;/Title&#62;
&#60;Categories&#62;
&#60;Category&#62;Tutorials&#60;/Category&#62;
&#60;Category&#62;AutoHotkey&#60;/Category&#62;
&#60;/Categories&#62;
&#60;Date&#62;12/12/2008&#60;/Date&#62;
&#60;/Tutorial&#62;
&#60;/RecentTutorials&#62;



The first thing you&#8217;re going to have to do is write some jQuery to request [...]]]></description>
			<content:encoded><![CDATA[<p>Suppose we have a file name xml file as below</p>
<p><span style="color: #000000;"><span style="color: #0600ff;">&lt;?xml</span> <span style="color: #060066;">version</span>=<span style="color: #ff0000;">&#8220;1.0&#8243;</span> <span style="color: #060066;">encoding</span>=<span style="color: #ff0000;">&#8220;utf-8&#8243;</span> <span style="color: #0600ff;">?&gt;</span></span></p>
<div class="geshifilter">
<div class="xml geshifilter-xml" style="font-family: monospace;"><span style="color: #000000;"><span style="color: #0600ff;">&lt;RecentTutorials<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Tutorial</span> <span style="color: #060066;">author</span>=<span style="color: #ff0000;">&#8220;The Reddest&#8221;</span><span style="color: #0600ff;">&gt;</span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Title<span style="color: #0600ff;">&gt;</span></span></span>Silverlight and the Netflix API<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Title<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Categories<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Category<span style="color: #0600ff;">&gt;</span></span></span>Tutorials<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Category<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Category<span style="color: #0600ff;">&gt;</span></span></span>Silverlight 2.0<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Category<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Category<span style="color: #0600ff;">&gt;</span></span></span>Silverlight<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Category<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Category<span style="color: #0600ff;">&gt;</span></span></span>C#<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Category<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Category<span style="color: #0600ff;">&gt;</span></span></span>XAML<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Category<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Categories<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Date<span style="color: #0600ff;">&gt;</span></span></span>1/13/2009<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Date<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Tutorial<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Tutorial</span> <span style="color: #060066;">author</span>=<span style="color: #ff0000;">&#8220;The Hairiest&#8221;</span><span style="color: #0600ff;">&gt;</span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Title<span style="color: #0600ff;">&gt;</span></span></span>Cake PHP 4 &#8211; Saving and Validating Data<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Title<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Categories<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Category<span style="color: #0600ff;">&gt;</span></span></span>Tutorials<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Category<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Category<span style="color: #0600ff;">&gt;</span></span></span>CakePHP<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Category<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Category<span style="color: #0600ff;">&gt;</span></span></span>PHP<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Category<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Categories<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Date<span style="color: #0600ff;">&gt;</span></span></span>1/12/2009<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Date<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Tutorial<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Tutorial</span> <span style="color: #060066;">author</span>=<span style="color: #ff0000;">&#8220;The Tallest&#8221;</span><span style="color: #0600ff;">&gt;</span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Title<span style="color: #0600ff;">&gt;</span></span></span>Silverlight 2 &#8211; Using initParams<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Title<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Categories<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Category<span style="color: #0600ff;">&gt;</span></span></span>Tutorials<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Category<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Category<span style="color: #0600ff;">&gt;</span></span></span>Silverlight 2.0<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Category<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Category<span style="color: #0600ff;">&gt;</span></span></span>Silverlight<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Category<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Category<span style="color: #0600ff;">&gt;</span></span></span>C#<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Category<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Category<span style="color: #0600ff;">&gt;</span></span></span>HTML<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Category<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Categories<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Date<span style="color: #0600ff;">&gt;</span></span></span>1/6/2009<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Date<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Tutorial<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Tutorial</span> <span style="color: #060066;">author</span>=<span style="color: #ff0000;">&#8220;The Fattest&#8221;</span><span style="color: #0600ff;">&gt;</span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Title<span style="color: #0600ff;">&gt;</span></span></span>Controlling iTunes with AutoHotkey<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Title<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Categories<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Category<span style="color: #0600ff;">&gt;</span></span></span>Tutorials<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Category<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Category<span style="color: #0600ff;">&gt;</span></span></span>AutoHotkey<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Category<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Categories<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;Date<span style="color: #0600ff;">&gt;</span></span></span>12/12/2008<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Date<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;/Tutorial<span style="color: #0600ff;">&gt;</span></span></span><br />
<span style="color: #000000;"><span style="color: #0600ff;">&lt;/RecentTutorials<span style="color: #0600ff;">&gt;</span></span></span></div>
<div class="xml geshifilter-xml" style="font-family: monospace;"></div>
<div class="xml geshifilter-xml" style="font-family: monospace;"></div>
<div class="xml geshifilter-xml" style="font-family: monospace;">
<p>The first thing you&#8217;re going to have to do is write some jQuery to request the XML document. This is a very simple AJAX request for the file.</p>
<div class="geshifilter">
<div class="javascript geshifilter-javascript" style="font-family: monospace;">$<span style="color: #000000;">(</span>document<span style="color: #000000;">)</span>.<span style="color: #000000;">ready</span><span style="color: #000000;">(</span><span style="color: #0600ff;">function</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />
<span style="color: #000000;">{</span><br />
$.<span style="color: #000000;">ajax</span><span style="color: #000000;">(</span><span style="color: #000000;">{</span><br />
type<span style="color: #000000;">:</span> <span style="color: #ff0000;">&#8220;GET&#8221;</span><span style="color: #000000;">,</span><br />
url<span style="color: #000000;">:</span> <span style="color: #ff0000;">&#8220;jquery_xml.xml&#8221;</span><span style="color: #000000;">,</span><br />
dataType<span style="color: #000000;">:</span> <span style="color: #ff0000;">&#8220;xml&#8221;</span><span style="color: #000000;">,</span><br />
success<span style="color: #000000;">:</span> parseXml<br />
<span style="color: #000000;">}</span><span style="color: #000000;">)</span><span style="color: #000000;">;</span><br />
<span style="color: #000000;">}</span><span style="color: #000000;">)</span><span style="color: #000000;">;</span></div>
</div>
<p>Now that that&#8217;s out of the way, we can start parsing the XML.  As you can see, when the request succeeds, the function <code>parseXML</code> is called. That&#8217;s where I&#8217;m going to put my code. Let&#8217;s start by finding the author of each tutorial, which are stored as attributes on the Tutorial tag.</p>
<div class="geshifilter">
<div class="javascript geshifilter-javascript" style="font-family: monospace;"><span style="color: #0600ff;">function</span> parseXml<span style="color: #000000;">(</span>xml<span style="color: #000000;">)</span><br />
<span style="color: #000000;">{</span><br />
<span style="color: #008000; font-style: italic;">//find every Tutorial and print the author</span><br />
$<span style="color: #000000;">(</span>xml<span style="color: #000000;">)</span>.<span style="color: #000000;">find</span><span style="color: #000000;">(</span><span style="color: #ff0000;">&#8220;Tutorial&#8221;</span><span style="color: #000000;">)</span>.<span style="color: #000000;">each</span><span style="color: #000000;">(</span><span style="color: #0600ff;">function</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />
<span style="color: #000000;">{</span><br />
$<span style="color: #000000;">(</span><span style="color: #ff0000;">&#8220;#output&#8221;</span><span style="color: #000000;">)</span>.<span style="color: #000000;">append</span><span style="color: #000000;">(</span>$<span style="color: #000000;">(</span><span style="color: #0600ff;">this</span><span style="color: #000000;">)</span>.<span style="color: #000000;">attr</span><span style="color: #000000;">(</span><span style="color: #ff0000;">&#8220;author&#8221;</span><span style="color: #000000;">)</span> <span style="color: #000000;">+</span> <span style="color: #ff0000;">&#8220;&lt;br /&gt;&#8221;</span><span style="color: #000000;">)</span><span style="color: #000000;">;</span><br />
<span style="color: #000000;">}</span><span style="color: #000000;">)</span><span style="color: #000000;">;</span></p>
<p><span style="color: #008000; font-style: italic;">// Output:</span><br />
<span style="color: #008000; font-style: italic;">// The Reddest</span><br />
<span style="color: #008000; font-style: italic;">// The Hairiest</span><br />
<span style="color: #008000; font-style: italic;">// The Tallest</span><br />
<span style="color: #008000; font-style: italic;">// The Fattest</span><br />
<span style="color: #000000;">}</span></div>
<div class="javascript geshifilter-javascript" style="font-family: monospace;"></div>
<div class="javascript geshifilter-javascript" style="font-family: monospace;"><span style="color: #000000;"><br />
</span></div>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.webburners.com/2009/04/parse-xml-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remotely login script throw curl in php</title>
		<link>http://www.webburners.com/2009/04/remotely-login-script-throw-curl-in-php/</link>
		<comments>http://www.webburners.com/2009/04/remotely-login-script-throw-curl-in-php/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 18:23:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[login using curl]]></category>
		<category><![CDATA[php curl]]></category>
		<category><![CDATA[remote login]]></category>

		<guid isPermaLink="false">http://www.webburners.com/?p=279</guid>
		<description><![CDATA[As we know php doesnt cum up with curl support by default for this u have to download a separte module libcurl which is basically for php. Using curl you can login to another site , grab the data and then log it off , just like a simple user do , you can use [...]]]></description>
			<content:encoded><![CDATA[<p>As we know php doesnt cum up with curl support by default for this u have to download a separte module libcurl which is basically for php. Using curl you can login to another site , grab the data and then log it off , just like a simple user do , you can use the below script for login to another site using curl</p>
<p><!--ec1-->&lt;?php<br />
// INIT CURL<br />
$ch = curl_init();</p>
<p>// SET URL FOR THE POST FORM LOGIN<br />
curl_setopt($ch, CURLOPT_URL, &#8216;http://www.external-site.com/Members/Login.php&#8217;);</p>
<p>// ENABLE HTTP POST<br />
curl_setopt ($ch, CURLOPT_POST, 1);</p>
<p>// SET POST PARAMETERS : FORM VALUES FOR EACH FIELD<br />
curl_setopt ($ch, CURLOPT_POSTFIELDS, &#8216;fieldname1=fieldvalue1&amp;fieldname2=fieldvalue2&#8242;);</p>
<p>// IMITATE CLASSIC BROWSER&#8217;S BEHAVIOUR : HANDLE COOKIES<br />
curl_setopt ($ch, CURLOPT_COOKIEJAR, &#8216;cookie.txt&#8217;);</p>
<p># Setting CURLOPT_RETURNTRANSFER variable to 1 will force cURL<br />
# not to print out the results of its query.<br />
# Instead, it will return the results as a string return value<br />
# from curl_exec() instead of the usual true/false.<br />
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);</p>
<p>// EXECUTE 1st REQUEST (FORM LOGIN)<br />
$store = curl_exec ($ch);</p>
<p>// SET FILE TO DOWNLOAD<br />
curl_setopt($ch, CURLOPT_URL, &#8216;http://www.external-site.com/Members/Downloads/AnnualReport.pdf&#8217;);</p>
<p>// EXECUTE 2nd REQUEST (FILE DOWNLOAD)<br />
$content = curl_exec ($ch);</p>
<p>// CLOSE CURL<br />
curl_close ($ch);</p>
<p>?&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webburners.com/2009/04/remotely-login-script-throw-curl-in-php/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP interview question part 4</title>
		<link>http://www.webburners.com/2009/04/php-interview-question-part-4/</link>
		<comments>http://www.webburners.com/2009/04/php-interview-question-part-4/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 17:11:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.webburners.com/?p=133</guid>
		<description><![CDATA[1. How many ways can we get the value of current session id?
session_id() returns the session id for the current session.
2. How can we destroy the session, how can we unset the variable of a session?
session_unregister () Unregister a global variable from the current session
session_unset () Free all session variables
3. How can we destroy the [...]]]></description>
			<content:encoded><![CDATA[<p>1. How many ways can we get the value of current session id?<br />
session_id() returns the session id for the current session.<br />
2. How can we destroy the session, how can we unset the variable of a session?<br />
session_unregister () Unregister a global variable from the current session<br />
session_unset () Free all session variables<br />
3. How can we destroy the cookie?</p>
<p>Ans:- Use setcookie function with all parameter but set the time limit in negative for suppose destroying a cookie for name admin just use s</p>
<pre class="code">setcookie ("admin", "", time() - 3600);</pre>
<p>4. How many ways we can pass the variable through the navigation between the pages?<br />
Ans:- Through QueryString and POST methods<br />
5. What is the difference between ereg_replace() and eregi_replace()?<br />
Ans:-eregi_replace() function is identical to ereg_replace() except that this ignores case distinction when matching alphabetic characters.eregi_replace() function is identical to ereg_replace() except that this ignores case distinction when matching alphabetic characters.</p>
<p>6. What are the different functions in sorting an array?<br />
Ans:-<br />
Sorting functions in PHP,<br />
asort-http://www.php.net/manual/en/function.asort.php<br />
arsort-http://www.php.net/manual/en/function.arsort.php<br />
ksort-http://www.php.net/manual/en/function.ksort.php<br />
krsort-http://www.php.net/manual/en/function.krsort.php<br />
uksort-http://www.php.net/manual/en/function.uksort.php<br />
sort-http://www.php.net/manual/en/function.sort.php<br />
natsort-http://www.php.net/manual/en/function.natsort.php<br />
rsort-http://www.php.net/manual/en/function.rsort.php<br />
7. How can we know the count/number of elements of an array?<br />
Ans:-2 ways<br />
a) sizeof($urarray) This function is an alias of count()<br />
b) count($urarray)<br />
interestingly if u just pass a simple var instead of a an array it will return 1.</p>
<p>8. What are the difference between abstract class and interface?<br />
Abstract class: abstract classes are the class where one or more methods are abstract but not necessarily all method has to be abstract. Abstract methods are the methods, which are declare in its class but not define. The definition of those methods should be in its extending class.but not necessary.<br />
Interface: Interfaces are one type of class where all the methods are abstract. That means all the methods only declared but not defined. All the methods must be define by its implemented class.<br />
9. How can we send mail-using JavaScript?</p>
<p>We can use mailto:gmail.com function to send mail through javascript<br />
10. How can we repair a mysql table?<br />
The syntex for repairing a mysql table is<br />
REPAIR TABLENAME, [TABLENAME, ], [Quick],[Extended]<br />
This command will repair the table specified if the quick is given the mysql will do a repair of only the index tree if the extended is given it will create index row by row<br />
11. What are the advantages of stored procedures, triggers, indexes?<br />
A stored procedure is a set of SQL commands that can be compiled and stored in the server. Once this has been done, clients don’t need to keep re-issuing the entire query but can refer to the stored procedure. This provides better overall performance because the query has to be parsed only once, and less information needs to be sent between the server and the client. You can also raise the conceptual level by having libraries of functions in the server. However, stored procedures of course do increase the load on the database server system, as more of the work is done on the server side and less on the client (application) side.<br />
Triggers will also be implemented. A trigger is effectively a type of stored procedure, one that is invoked when a particular event occurs. For example, you can install a stored procedure that is triggered each time a record is deleted from a transaction table and that stored procedure automatically deletes the corresponding customer from a customer table when all his transactions are deleted.<br />
Indexes are used to find rows with specific column values quickly. Without an index, MySQL must begin with the first row and then read through the entire table to find the relevant rows. The larger the table, the more this costs. If the table has an index for the columns in question, MySQL can quickly determine the position to seek to in the middle of the data file without having to look at all the data. If a table has 1,000 rows, this is at least 100 times faster than reading sequentially. If you need to access most of the rows, it is faster to read sequentially, because this minimizes disk seeks.<br />
12. What is the maximum length of a table name, database name, and fieldname in mysql?<br />
Database name- 64<br />
Table name -64<br />
Fieldname-64<br />
13. How many values can the SET function of mysql takes?<br />
Mysql set can take zero or more values but at the maximum it can take 64 values<br />
14. What are the other commands to know the structure of table using mysql commands except explain command?<br />
describe table_name;<br />
15. How many tables will create when we create table, what are they?<br />
3 tables will create when we create table. They are<br />
The ‘.frm’ file stores the table definition.<br />
The data file has a ‘.MYD’ (MYData) extension.<br />
The index file has a ‘.MYI’ (MYIndex) extension,</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webburners.com/2009/04/php-interview-question-part-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP interview Quesion Part 3</title>
		<link>http://www.webburners.com/2009/04/php-interview-quesion-part-iii/</link>
		<comments>http://www.webburners.com/2009/04/php-interview-quesion-part-iii/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 16:58:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.webburners.com/?p=131</guid>
		<description><![CDATA[1. 	How can we encrypt the username and password using php?
It all depends upon either you want to decode the password or not if u dont want to decode the password then the best way is to use the md5 function but if you want to decode as well either use baase_enocde function or use [...]]]></description>
			<content:encoded><![CDATA[<ul>1. 	How can we encrypt the username and password using php?<br />
It all depends upon either you want to decode the password or not if u dont want to decode the password then the best way is to use the md5 function but if you want to decode as well either use baase_enocde function or use inbuilt classes freely available for encoding and decoding and you can also refer to phpclasses.com and php.net for this for base encodingt We can use  data using base64_encode($string) and can decode using base64_decode($string);</p>
<p>2. What are the features and advantages 	of OBJECT ORIENTED PROGRAMMING?</ul>
<ul> In short extendablity, flexablity, ease to maintain , Less coding , Reusablity and security</ul>
<ul> One of the main advantages of OO programming is its ease of modification; objects can easily be modified and added to a system there by reducing maintenance costs. OO programming is also considered to be better at modeling the real world than is procedural programming. It allows for more complicated and flexible interactions. OO systems are also easier for non-technical personnel to understand and easier for them to participate in the maintenance and enhancement of a system because it appeals to natural human cognition patterns.<br />
For some systems, an OO approach can speed development time since many objects are standard across systems and can be reused. Components that manage dates, shipping, shopping carts, etc. can be purchased and easily modified for a specific system.</ul>
<p>3. What is 	the use of friend function?<br />
Friend functions<br />
Sometimes a function is best shared among a number of different classes. Such functions can be declared either as member functions of one class or as global functions. In either case they can be set to be friends of other classes, by using a friend specifier in the class that is admitting them. Such functions can use all attributes of the class whichnames them as a friend, as if they were themselves members of that class.<br />
A friend declaration is essentially a prototype for a member function, but instead of requiring an implementation with the name of that class attached by the double colon syntax, a global function or member function of another class provides the match.</p>
<p>class mylinkage<br />
{<br />
private:<br />
mylinkage * prev;<br />
mylinkage * next;<br />
protected:<br />
friend void set_prev(mylinkage* L, mylinkage* N);<br />
void set_next(mylinkage* L);<br />
public:<br />
mylinkage * succ();<br />
mylinkage * pred();<br />
mylinkage();<br />
};<br />
void mylinkage::set_next(mylinkage* L) { next = L; }<br />
void set_prev(mylinkage * L, mylinkage * N ) { N-&gt;prev = L; }</p>
<p>Friends in other classes<br />
It is possible to specify a member function of another class as a friend as follows:</p>
<p>class C<br />
{<br />
friend int B::f1();<br />
};<br />
class B<br />
{<br />
int f1();<br />
};</p>
<p>It is also possible to specify all the functions in another class as friends, by specifying the entire class as a friend.</p>
<p>class A<br />
{<br />
friend class B;<br />
};<br />
Friend functions allow binary operators to be defined which combine private data in a pair of objects. This is particularly powerful when using the operator overloading features of C++. We will return to it when we look at overloading.</p>
<ul> 4. What are the differences 	between PROCEDURE ORIENTED LANGUAGES and OBJECT ORIENTED 	LANGUAGES?<br />
Traditional programming has the following 	characteristics:<br />
Functions are written sequentially, so that a 	change in programming can affect any code that follows it.<br />
If a function is used multiple times in a system (i.e., a piece of code that manages the date), it is often simply cut and pasted into each program (i.e., a change log, order function, fulfillment system, etc). If a date change is needed (i.e., Y2K when the code needed to be changed to handle four numerical digits instead of two), all these pieces of code must be found, modified, and tested.<br />
Code (sequences of computer instructions) and data (information on which the instructions operates on) are kept separate. Multiple sets of code can access and modify one set of data. One set of code may rely on data in multiple places. Multiple sets of code and data are required to work together. Changes made to any of the code sets and data sets can cause problems through out the system.<br />
Object-Oriented 	programming takes a radically different approach:<br />
Code and data are merged into one indivisible item â€“ an object (the term “component” has also been used to describe an object.) An object is an abstraction of a set of real-world things (for example, an object may be created around “date”) The object would contain all information and functionality for that thing (A date<br />
object it may contain labels like January, February, Tuesday, Wednesday. It may contain functionality that manages leap years, determines if it is a business day or a holiday, etc., See Fig. 1). Ideally, information about a particular thing should reside in only one place in a system. The information within an object is encapsulated (or hidden) from the rest of the system.<br />
A system is composed of multiple objects (i.e., date function, reports, order processing, etc., See Fig 2). When one object needs information from another object, a request is sent asking for specific information. (for example, a report object may need to know what todayâ€™s date is and will send a request to the date object) These requests are called messages and each object has an interface that manages messages.<br />
OO programming languages include features such as “class”, “instance”, “inheritance”, and “polymorphism” that increase the power and flexibility of an object.</ul>
<p>5. What are the different types of errors in php?<br />
Three are three types of errors:<br />
1. Notices: These are trivial, non-critical errors that PHP encounters while executing a script &#8211; for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all &#8211; although, as you will see, you can change this default behaviour.<br />
2. Warnings: These are more serious errors &#8211; for example, attempting to include() a file which does not exist. By default, these errors are displayed to the user, but they do not result in script termination.<br />
3. Fatal errors: These are critical errors &#8211; for example, instantiating an object of a non-existent class, or calling a non-existent function. These errors cause the immediate termination of the script, and PHP’s default behaviour is to display them to the user when they take place.<br />
6. What is the functionality of the function strstr and stristr?<br />
strstr() returns part of a given string from the first occurrence of a given substring to the end of the string. For example: strstr(”user@example.com”,”@”) will return “@example.com”.<br />
stristr() is idential to strstr() except that it is case insensitive.</p>
<p>7. What is the functionality of the function htmlentities? Answer: htmlentities â€” Convert all applicable characters to HTML entities<br />
This function is identical to htmlspecialchars() in all ways, except with htmlentities(), all characters which have HTML character entity equivalents are translated into these entities.<br />
8. How can we get second of the current time using date function?<br />
$second = date(”s”);<br />
9. What is meant by urlencode and urldocode?<br />
urlencode() returns the URL encoded version of the given string. URL coding converts special characters into % signs followed by two hex digits. For example: urlencode(”10.00%”) will return “10%2E00%25?. URL encoded strings are safe to be used as part of URLs.<br />
urldecode() returns the URL decoded version of the given string.<br />
10. What is the difference between the functions unlink and unset?<br />
unlink() deletes the given file from the file system.<br />
unset() makes a variable undefined.<br />
11. How can we register the variables into a session?<br />
We can use the session_register ($ur_session_var) function.<br />
12. How can we get the properties (size, type, width, height) of an image using php image functions?<br />
To get the Image type use exif_imagetype () function<br />
To get the Image size use getimagesize () function<br />
To get the image width use imagesx () function<br />
To get the image height use imagesy() function</p>
<p>13. What is the maximum size of a file that can be uploaded using php and how can we change this?<br />
You can change maximum size of a file set upload_max_filesize variable in php.ini file where as the max size by default is 2 mb<br />
14. How can we increase the execution time of a php script?<br />
Set max_execution_time variable in php.ini file to your desired time in second.<br />
15. How can we take a backup of a mysql table and how can we restore it.?<br />
Answer: Create a full backup of your database: shell&gt; mysqldump “tab=/path/to/some/dir opt db_name Or: shell&gt; mysqlhotcopy db_name /path/to/some/dir<br />
The full backup file is just a set of SQL statements, so restoring it is very easy:</p>
<p>shell&gt; mysql “.”Executed”;<br />
mysql_close($link2);</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webburners.com/2009/04/php-interview-quesion-part-iii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Php interview Questions &#8211; part II</title>
		<link>http://www.webburners.com/2009/04/php-interview-questions-part/</link>
		<comments>http://www.webburners.com/2009/04/php-interview-questions-part/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 16:39:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[interview php questions]]></category>
		<category><![CDATA[php interview question]]></category>
		<category><![CDATA[question post]]></category>

		<guid isPermaLink="false">http://www.webburners.com/?p=126</guid>
		<description><![CDATA[1. What is the differences between GET and POST methods in form 	submitting?
- On the server side, the main difference between GET and POST is where the submitted is stored. The $_GET array stores data submitted by the GET method. The $_POST array stores data submitted by the POST method.
On the client  side, the difference [...]]]></description>
			<content:encoded><![CDATA[<ul>1. What is the differences between GET and POST methods in form 	submitting?</p>
<p>- On the server side, the main difference between GET and POST is where the submitted is stored. The $_GET array stores data submitted by the GET method. The $_POST array stores data submitted by the POST method.<br />
On the client  side, the difference is that data submitted by the GET method will be displayed in the browsers address field. Data submitted by the POST method will not be displayed anywhere on the browser.</p>
<p>GET method is used for chunk of information for less insensitve data and Post method is used for large amotund of data which is sensitive in nature.</p>
<p>2. 	Who is the father of php and explain the changes in php 	versions?<br />
- Rasmus Lerdorf</p>
<p>3. How can we submit from 	without a submit button?<br />
We can Trigger a Javascript code on a particular event in javascript function Like on button click we can call a function which contain the function submit() . In the JavaScript code, we can call the document.form.submit() function to submit the form.</p>
<p>4. What is the difference between 	mysql_fetch_object and mysql_fetch_array?<br />
mssql fetch object will take first single matching record where mysql_fetch_array will get all matching records from the table in an array.</ul>
<p>5. How can we create a database using php and 	mysql?</p>
<p>We can call a inbuilt function for creating a database in PHP i.e mysql_create_db() but we have to take this into consideration                                      while  working on server the user should have rights to create the database and for mysql we can simply call the query the database i.e        create database;</p>
<p>6. 	What are the differences between require and include, 	include_once?</p>
<p><strong>include and require it differ in </strong> how they handle failures. If the file is not found by require(), it will definatly cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.</p>
<p>7. How many ways we can get the data in 	result set of mysql Using php?<br />
As individual objects so single 	record or as a set or arrays.</p>
<ul> 8. What are the different tables present in mysql, which type of table is generated when we are creating a table in the following<br />
syntax: create table emp(no int(12),name 	varchar(20)) ?<br />
Total 5 types of tables we can create<br />
1. 	MyISAM<br />
2. Heap<br />
3. Merge<br />
4. InnoDB<br />
5. ISAM<br />
6. 	BDB<br />
MyISAM is the default storage engine as of MySQL 3.23.</ul>
<p>9. What 	is the difference between $message and $$message?<br />
They are both variables. But $message is a variable with a constant or you can say a fixed value but $$message is a variable which stores the address of $message<br />
10. 	How can I execute a php script using command line?<br />
Just run the PHP CLI (Command Line Interface) program and provide the PHP script file name as the command line argument. For example, “php myScript.php”, assuming “php” is the command to invoke the CLI program.<br />
Be aware that if your PHP script was written for the Web CGI interface, it may not execute properly in command line environment.</p>
<p>11. Suppose your ZEND engine supports the mode Then 	how can u configure your php ZEND engine to support mode ?<br />
Just change the line  short_open_tag = off in php.ini file settings. Then your php 	ZEND engine support only mode.</p>
<p>12. What is 	meant by nl2br()?<br />
nl2br() Inserts HTML line breaks before all newlines in a string string nl2br (string); Returns string with br inserted before all newlines. For example: echo nl2br(”Gud day \n Sir”) will output “gud day \n sir” to your browser.</p>
<p>13. What 	are the current versions of apache, php, and mysql?<br />
PHP: 	php5.4.2<br />
MySQL: MySQL 5<br />
Apache: Apache 2</p>
<p>14. What are 	the reason for chossing  LAMP (Linux, apache, mysql, php) instead 	of WAMP?<br />
All of those are open source resource. Security of linux is very very more than windows. Apache is a better server that IIS both in functionality and security. Mysql is world most popular open source database. Php is more faster that asp or any other scripting language.</p>
<p>15. How can we encrypt and decrypt a data present in a 	mysql table using mysql?<br />
Two  Functions are there for this : AES_ENCRYPT () and AES_DECRYPT ()</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webburners.com/2009/04/php-interview-questions-part/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interview question &#8212; Part 5</title>
		<link>http://www.webburners.com/2009/04/interview-question-part-2/</link>
		<comments>http://www.webburners.com/2009/04/interview-question-part-2/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 16:02:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[differnence between get and post]]></category>
		<category><![CDATA[friend function]]></category>
		<category><![CDATA[get method]]></category>
		<category><![CDATA[objects]]></category>
		<category><![CDATA[objects passed by value or by reference]]></category>
		<category><![CDATA[php interview question]]></category>
		<category><![CDATA[post method]]></category>
		<category><![CDATA[submit form without submit]]></category>
		<category><![CDATA[_sleep]]></category>
		<category><![CDATA[_wakeup]]></category>

		<guid isPermaLink="false">http://www.webburners.com/?p=123</guid>
		<description><![CDATA[1. What is the purpose of the following files having extensions 1) frm 2) MYD 3) MYI. What these files contains?
In MySql, the default table type is MyISAM.
Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the file [...]]]></description>
			<content:encoded><![CDATA[<p>1. What is the purpose of the following files having extensions 1) frm 2) MYD 3) MYI. What these files contains?<br />
In MySql, the default table type is MyISAM.<br />
Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the file type.<br />
The ‘.frm’ file stores the table definition.<br />
The data file has a ‘.MYD’ (MYData) extension.<br />
The index file has a ‘.MYI’ (MYIndex) extension,</p>
<p>2. What is maximum size of a database in mysql?<br />
If the operating system or filesystem places a limit on the number of files in a directory, MySQL is bound by that constraint.<br />
The efficiency of the operating system in handling large numbers of files in a directory can place a practical limit on the number of tables in a database. If the time required to open a file in the directory increases significantly as the number of files increases, database performance can be adversely affected.<br />
The amount of available disk space limits the number of tables.<br />
MySQL 3.22 had a 4GB (4 gigabyte) limit on table size. With the MyISAM storage engine in MySQL 3.23, the maximum table size was increased to 65536 terabytes (2567 â€“ 1 bytes). With this larger allowed table size, the maximum effective table size for MySQL databases is usually determined by operating system constraints on file sizes, not by MySQL internal limits.<br />
The InnoDB storage engine maintains InnoDB tables within a tablespace that can be created from several files. This allows a table to exceed the maximum individual file size. The tablespace can include raw disk partitions, which allows extremely large tables. The maximum tablespace size is 64TB.<br />
The following table lists some examples of operating system file-size limits. This is only a rough guide and is not intended to be definitive. For the most up-to-date information, be sure to check the documentation specific to your operating system.<br />
Operating System File-size Limit<br />
Linux 2.2-Intel 32-bit 2GB (LFS: 4GB)<br />
Linux 2.4+ (using ext3 filesystem) 4TB<br />
Solaris 9/10 16TB<br />
NetWare w/NSS filesystem 8TB<br />
Win32 w/ FAT/FAT32 2GB/4GB<br />
Win32 w/ NTFS 2TB (possibly larger)<br />
MacOS X w/ HFS+ 2TB<br />
3. Give the syntax of Grant and Revoke commands?<br />
The generic syntax for grant is as following<br />
&gt; GRANT [rights] on [database/s] TO [username@hostname] IDENTIFIED BY [password]<br />
now rights can be<br />
a) All privileges<br />
b) combination of create, drop, select, insert, update and delete etc.<br />
We can grant rights on all databse by using *.* or some specific database by database.* or a specific table by database.table_name<br />
username@hotsname can be either username@localhost, username@hostname and username@%<br />
where hostname is any valid hostname and % represents any name, the *.* any condition<br />
password is simply the password of user<br />
The generic syntax for revoke is as following<br />
&gt; REVOKE [rights] on [database/s] FROM [username@hostname]<br />
now rights can be as explained above<br />
a) All privileges<br />
b) combination of create, drop, select, insert, update and delete etc.<br />
username@hotsname can be either username@localhost, username@hostname and username@%<br />
where hostname is any valid hostname and % represents any name, the *.* any condition<br />
4. Explain Normalization concept?<br />
The normalization process involves getting our data to conform to three progressive normal forms, and a higher level of normalization cannot be achieved until the previous levels have been achieved (there are actually five normal forms, but the last two are mainly academic and will not be discussed).<br />
First Normal Form<br />
The First Normal Form (or 1NF) involves removal of redundant data from horizontal rows. We want to ensure that there is no duplication of data in a given row, and that every column stores the least amount of information possible (making the field atomic).<br />
Second Normal Form<br />
Where the First Normal Form deals with redundancy of data across a horizontal row, Second Normal Form (or 2NF) deals with redundancy of data in vertical columns. As stated earlier, the normal forms are progressive, so to achieve Second Normal Form, your tables must already be in First Normal Form.<br />
Third Normal Form<br />
I have a confession to make; I do not often use Third Normal Form. In Third Normal Form we are looking for data in our tables that is not fully dependant on the primary key, but dependant on another value in the table<br />
5. How can we find the number of rows in a table using mysql?<br />
Answer: Use this for mysql<br />
&gt;SELECT COUNT(*) FROM table_name;<br />
but if u r particular about no of rows with some special result<br />
do this<br />
&gt;SELECT [colms],COUNT(*) FROM table_name [where u put conditions];<br />
68. How can we find the number of rows in a result set using php?<br />
Answer: for PHP</p>
<p>$result = mysql_query($any_valid_sql, $database_link);<br />
$num_rows = mysql_num_rows($result);<br />
echo “$num_rows rows found”;<br />
6. How many ways we can we find the current date using mysql?<br />
SELECT CURDATE();<br />
CURRENT_DATE() = CURDATE()<br />
for time use<br />
SELECT CURTIME();<br />
CURRENT_TIME() = CURTIME()<br />
7. What are the advantages and disadvantages of CASCADE STYLE SHEETS?<br />
External Style Sheets<br />
Advantages<br />
Can control styles for multiple documents at once<br />
Classes can be created for use on multiple HTML element types in many documents<br />
Selector and grouping methods can be used to apply styles under complex contexts<br />
Disadvantages<br />
An extra download is required to import style information for each document<br />
The rendering of the document may be delayed until the external style sheet is loaded<br />
Becomes slightly unwieldy for small quantities of style definitions<br />
Embedded Style Sheets<br />
Advantages<br />
Classes can be created for use on multiple tag types in the document<br />
Selector and grouping methods can be used to apply styles under complex contexts<br />
No additional downloads necessary to receive style information<br />
Disadvantages<br />
This method can not control styles for multiple documents at once<br />
Inline Styles<br />
Advantages<br />
Useful for small quantities of style definitions<br />
Can override other style specification methods at the local level so only exceptions need to be listed in conjunction with other style methods<br />
Disadvantages<br />
Does not distance style information from content (a main goal of SGML/HTML)<br />
Can not control styles for multiple documents at once<br />
Author can not create or control classes of elements to control multiple element types within the document<br />
Selector grouping methods can not be used to create complex element addressing scenarios</p>
<p>8. What are the advantages/disadvantages of mysql and php?<br />
Both of them are open source software (so free of cost), support cross platform. php is faster then ASP and JSP.<br />
9. What is the difference between GROUP BY and ORDER BY in Sql?<br />
To sort a result, use an ORDER BY clause.<br />
The most general way to satisfy a GROUP BY clause is to scan the whole table and create a new temporary table where all rows from each group are consecutive, and then use this temporary table to discover groups and apply aggregate functions (if any).<br />
ORDER BY [col1],[col2],[coln]; Tels DBMS according to what columns it should sort the result. If two rows will hawe the same value in col1 it will try to sort them according to col2 and so on.<br />
GROUP BY [col1],[col2],â€¦,[coln]; Tels DBMS to group results with same value of column col1. You can use COUNT(col1), SUM(col1), AVG(col1) with it, if you want to count all items in group, sum all values or view average<br />
10. What is the difference between char and varchar data types?<br />
char(M) M bytes 0<br />
80. How can we change the name of a column of a table?<br />
MySQL query to rename table: RENAME TABLE tbl_name TO new_tbl_name<br />
[, tbl_name2 TO new_tbl_name2]<br />
or,<br />
ALTER TABLE tableName CHANGE OldName newName.<br />
11. How can we change the name and data type of a column of a table?<br />
ALTER [IGNORE] TABLE tbl_name<br />
alter_specification [, alter_specification] | CHANGE [COLUMN] old_col_name column_definition<br />
[FIRST|AFTER col_name]<br />
12. What are the differences between drop a table and truncate a table?<br />
Answer: Delete a Table or DatabaseTo delete a table (the table structure, attributes, and indexes will also be deleted).<br />
What if we only want to get rid of the data inside a table, and not the table itself? Use the TRUNCATE TABLE command (deletes only the data inside the table).<br />
13. When viewing an HTML page in a Browser, the Browser often keeps this page in its cache. What can be possible advantages/disadvantages of page caching? How can you prevent caching of a certain page (please give several alternate solutions)?<br />
When you use the metatag in the header section at the beginning of an HTML Web page, the Web page may still be cached in the Temporary Internet Files folder.<br />
A page that Internet Explorer is browsing is not cached until half of the 64 KB buffer is filled. Usually, metatags are inserted in the header section of an HTML document, which appears at the beginning of the document. When the HTML code is parsed, it is read from top to bottom. When the metatag is read, Internet Explorer looks for the existence of the page in cache at that exact moment. If it is there, it is removed. To properly prevent the Web page from appearing in the cache, place another header section at the end of the HTML ocument.<br />
14. What are the different ways to login to a remote server? Explain the means, advantages and disadvantages?<br />
There is at least 3 ways to logon to a remote server:<br />
Use ssh or telnet if you concern with security<br />
You can also use rlogin to logon to a remote server.</p>
<p>15. What is meant by MIME?<br />
Multipurpose Internet Mail Extensions.<br />
WWW’s ability to recognise and handle files of different types is largely dependent on the use of the MIME (Multipurpose Internet Mail Extensions) standard. The standard provides for a system of registration of file types with information about the applications needed to process them. This information is incorporated into Web server and browser software, and enables the automatic recognition and display of registered file types.<br />
16. What is meant by PEAR in php?<br />
PEAR is short for “PHP Extension and Application Repository” and is pronounced just like the fruit. The purpose of PEAR is to provide:<br />
A structured library of open-sourced code for PHP users<br />
A system for code distribution and package maintenance<br />
A standard style for code written in PHP<br />
The PHP Foundation Classes (PFC),<br />
The PHP Extension Community Library (PECL),<br />
A web site, mailing lists and download mirrors to support the PHP/PEAR community<br />
PEAR is a community-driven project with the PEAR Group as the governing body. The project has been founded by Stig S. Bakken in 1999 and quite a lot of people have joined the project since then.<br />
<a href="http://pear.php.net/manual/en/introduction.php">http://pear.php.net/manual/en/introduction.php</a><br />
96. How can I use the COM components in php?<br />
The COM class provides a framework to integrate (D)COM components into your PHP scripts.<br />
string COM::COM ( string module_name [, string server_name [, int codepage]])<br />
COM class constructor. Parameters:<br />
module_name<br />
name or class-id of the requested component.<br />
server_name<br />
name of the DCOM server from which the component should be fetched. If NULL, localhost is assumed. To allow DCOM com.allow_dcom has to be set to TRUE in php.ini.<br />
codepage<br />
specifies the codepage that is used to convert php-strings to unicode-strings and vice versa. Possible values are CP_ACP, CP_MACCP, CP_OEMCP, CP_SYMBOL, CP_THREAD_ACP, CP_UTF7 and CP_UTF8.<br />
Usage:<br />
Version}\n”; //bring it to front $word-&gt;Visible = 1; //open an empty document $word-&gt;Documents-&gt;Add(); //do some weird stuff $word-&gt;Selection-&gt;TypeText(”This is a testâ€¦”); $word-&gt;Documents[1]-&gt;SaveAs(”Useless test.doc”); //closing word $word-&gt;Quit(); //free the object $word-&gt;Release(); $word = null; ?&gt;<br />
17. How can we know that a session is started or not?<br />
a session starts by session_start()function.<br />
this session_start() is always declared in header portion.it always declares first.then we write session_register().<br />
18. What is the default session time in php and how can I change it?<br />
The default session time in php is until closing of browser or 24 mins which is earlier<br />
19. What changes I have to done in php.ini file for file uploading?<br />
Make the following Line uncomment like:<br />
; Whether to allow HTTP file uploads.<br />
file_uploads = On<br />
; Temporary directory for HTTP uploaded files (will use system default if not<br />
; specified).<br />
upload_tmp_dir = C:\apache2triad\temp<br />
; Maximum allowed size for uploaded files.<br />
upload_max_filesize = 2M</p>
<p>post_max_limit =8m</p>
<p>you have to increase those limits to increase the file size upload<br />
20. What are the differences between mysql_fetch_array(), mysql_fetch_object(), mysql_fetch_row()?<br />
mysql_fetch_array â€” Fetch a result row as an associative array, a numeric array, or both.<br />
mysql_fetch_object ( resource result )<br />
Returns an object with properties that correspond to the fetched row and moves the internal data pointer ahead. Returns an object with properties that correspond to the fetched row, or FALSE if there are no more rows<br />
mysql_fetch_row() fetches one row of data from the result associated with the specified result identifier. The row is returned as an array. Each result column is stored in an array offset, starting at offset 0.<br />
21. How can I set a cron and how can I execute it in Unix, Linux, and windows?<br />
Cron is very simply a Linux module that allows you to run commands at predetermined times or intervals. In Windows, itâ€™s called Scheduled Tasks. The name Cron is in fact derived from the same word from which we get the word chronology, which means order of time.<br />
The easiest way to use crontab is via the crontab command.<br />
# crontab â€“e<br />
This command â€˜editsâ€™ the crontab. Upon employing this command, you will be able to enter the commands that you wish to run. My version of Linux uses the text editor vi. You can find information on using vi here.<br />
The syntax of this file is very important â€“ if you get it wrong, your crontab will not function properly. The syntax of the file should be as follows:<br />
minutes hours day_of_month month day_of_week command<br />
All the variables, with the exception of the command itself, are numerical constants. In addition to an asterisk (*), which is a wildcard that allows any value, the ranges permitted for each field are as follows:<br />
Minutes: 0-59<br />
Hours: 0-23<br />
Day_of_month: 1-31<br />
Month: 1-12<br />
Weekday: 0-6<br />
We can also include multiple values for each entry, simply by separating each value with a comma.<br />
command can be any shell command and, as we will see momentarily, can also be used to execute a Web document such as a PHP file.<br />
So, if we want to run a script every Tuesday morning at 8:15 AM, our mycronjob file will contain the following content on a single line:<br />
15 8 * * 2 /path/to/scriptname<br />
This all seems simple enough, right? Not so fast! If you try to run a PHP script in this manner, nothing will happen (barring very special configurations that have PHP compiled as an executable, as opposed to an Apache module). The reason is that, in order for PHP to be parsed, it needs to be passed through Apache. In other words, the page needs to be called via a browser or other means of retrieving Web content.<br />
For our purposes, Iâ€™ll assume that your server configuration includes wget, as is the case with most default configurations. To test your configuration, log in to shell. If youâ€™re using an RPM-based system (e.g. Redhat or Mandrake), type the following:<br />
# wget â€“help<br />
If you are greeted with a wget package identification, it is installed in your system.<br />
You could execute the PHP by invoking wget on the URL to the page, like so:<br />
# wget <a href="http://www.example.com/file.php">http://www.example.com/file.php</a><br />
Now, letâ€™s go back to the mailstock.php file we created in the first part of this article. We saved it in our document root, so it should be accessible via the Internet. Remember that we wanted it to run at 4PM Eastern time, and send you your precious closing bell report? Since Iâ€™m located in the Eastern timezone, we can go ahead and set up our crontab to use 4:00, but if you live elsewhere, you might have to compensate for the time difference when setting this value.<br />
This is what my crontab will look like:<br />
0 4 * * 1,2,3,4,5 wget <a href="http://www.example.com/mailstock.php">http://www.example.com/mailstock.php</a></p>
<p>22. Steps for the payment gateway processing?<br />
An online payment gateway is the interface between your merchant account and your Web site. The online payment gateway allows you to immediately verify credit card transactions and authorize funds on a customerâ€™s credit card directly from your Web site. It then passes the transaction off to your merchant bank for processing, commonly referred to as transaction batching<br />
23. How many ways I can register the variables into session?<br />
session_register(); $_SESSION[]; $HTTP_SESSION_VARS[];</p>
<p>24. How many ways I can redirect a php page?<br />
Here are the possible ways of php page redirection.<br />
Using Java script:<br />
‘; echo ‘window.location.href=”‘.$filename.’”;’; echo ”; echo ”; echo ”; echo ”; } } redirect(’http://maosjb.com’); ?&gt;<br />
Using php function:<br />
Header(”Location:http://maosjb.com “);<br />
25. List out different arguments in php header function?<br />
void header ( string string [, bool replace [, int http_response_code]])<br />
26. What type of headers have to add in the mail function in which file a attached?</p>
<p>$boundary = ‘â€”â€“=’ . md5( uniqid ( rand() ) );<br />
$headers = “From: \”Me\”\n”;<br />
$headers .= “MIME-Version: 1.0\n”;<br />
$headers .= “Content-Type: multipart/mixed; boundary=\”$boundary\”&#8221;;<br />
27. What is the difference between and And which can be preferable?<br />
move_uploaded_file ( string filename, string destination)<br />
This function checks to ensure that the file designated by filename is a valid upload file (meaning that it was uploaded via PHP’s HTTP POST upload mechanism). If the file is valid, it will be moved to the filename given by destination.<br />
If filename is not a valid upload file, then no action will occur, and move_uploaded_file() will return FALSE.<br />
If filename is a valid upload file, but cannot be moved for some reason, no action will occur, and move_uploaded_file() will return FALSE. Additionally, a warning will be issued.<br />
28. How can I embed a java programme in php file and what changeshave to be done in php.ini file?<br />
There are two possible ways to bridge PHP and Java: you can either integrate PHP into a Java Servlet environment, which is the more stable and efficient solution, or integrate Java support into PHP. The former is provided by a SAPI module that interfaces with the Servlet server, the latter by this Java extension.<br />
The Java extension provides a simple and effective means for creating and invoking methods on Java objects from PHP. The JVM is created using JNI, and everything runs in-process.<br />
Example Code:<br />
getProperty(’java.version’) . ”; echo ‘Java vendor=’ . $system-&gt;getProperty(’java.vendor’) . ”; echo ‘OS=’ . $system-&gt;getProperty(’os.name’) . ‘ ‘ . $system-&gt;getProperty(’os.version’) . ‘ on ‘ . $system-&gt;getProperty(’os.arch’) . ‘ ‘; // java.util.Date example $formatter = new Java(’java.text.SimpleDateFormat’, “EEEE, MMMM dd, yyyy ‘at’ h:mm:ss a zzzz”); echo $formatter-&gt;format(new Java(’java.util.Date’)); ?&gt;<br />
The behaviour of these functions is affected by settings in php.ini.<br />
Table 1. Java configuration options<br />
Name<br />
Default<br />
Changeable<br />
java.class.path<br />
NULL<br />
PHP_INI_ALL<br />
Name Default Changeable<br />
java.home<br />
NULL<br />
PHP_INI_ALL<br />
java.library.path<br />
NULL<br />
PHP_INI_ALL<br />
java.library<br />
JAVALIB<br />
PHP_INI_ALL<br />
29. How can I find what type of images that the php version supports?<br />
Using Imagetypes() function we can know</p>
<p>30. How can we send mail using JavaScript?<br />
No. You can’t send mail using Javascript. But you can execute a client side email client to send the email using mailto: code.<br />
Using clientside email client</p>
<p>function myfunction(form)<br />
{<br />
tdata=document.myform.tbox1.value;<br />
location=”mailto:mailid@domain.com?subject=”+tdata+”/MYFORM”;<br />
return true; }</p>
<ul>}</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.webburners.com/2009/04/interview-question-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interview questions For PHP</title>
		<link>http://www.webburners.com/2009/04/interview-questions-for-php/</link>
		<comments>http://www.webburners.com/2009/04/interview-questions-for-php/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 15:48:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[constants in php]]></category>
		<category><![CDATA[interview php question]]></category>
		<category><![CDATA[interview questions]]></category>
		<category><![CDATA[require and include in php]]></category>
		<category><![CDATA[tech interview]]></category>
		<category><![CDATA[ternary operators]]></category>

		<guid isPermaLink="false">http://www.webburners.com/?p=120</guid>
		<description><![CDATA[


What does a special set of tags 	&#60;?= and ?&#62; do in PHP?
Its called short tag , in this case 	the output is directly displayed on the browser without using the 	echo or print statement.


What’s the difference between 	include and require,include_once and require_once? &#8211; In case of 	include and require it differ in  how [...]]]></description>
			<content:encoded><![CDATA[<p><!-- 		@page { size: 21cm 29.7cm; margin: 2cm } 		P { margin-bottom: 0.21cm } --></p>
<ul>
<li>
<p style="margin-bottom: 0cm;"><strong>What does a special set of tags 	&lt;?= and ?&gt; do in PHP?</strong></p>
<p style="margin-bottom: 0cm;">Its called short tag , in this case 	the output is directly displayed on the browser without using the 	echo or print statement.</p>
</li>
<li>
<p style="margin-bottom: 0cm;"><strong>What’s the difference between 	include and require,include_once and require_once? &#8211; In case of 	include and require it differ in </strong> how they handle failures. If 	the file is not found by require(), it will definatly cause a fatal 	error and halt the execution of the script. If the file is not found 	by include(), a warning will be issued, but execution will continue.</p>
<p style="margin-bottom: 0cm;">Where as in case of include_once and 	require_once the basic differnence remain the same as      the above 	mentioned but both have a common feature in which the script or the 	file is included  only once irrespective of how many times a file is 	included in the program , it definatley fast up the execution where 	same file is included many times.</p>
<p style="margin-bottom: 0cm;">
</li>
<li><strong>I am trying to assign a variable the value of 0123, but it 	keeps coming up with a different number, what’s the problem?</strong> -
<p>PHP Interpreter treats numbers beginning with 0 as octal. Thats 	the main reason.</li>
<li>
<p style="margin-bottom: 0cm;"><a name="more-243"></a><strong>Would I 	use print &#8220;$a dollars&#8221; or &#8220;{$a} dollars&#8221; to 	print out the amount of dollars in this example?</strong> &#8211; In this 	example it wouldn’t matter, since the variable is all by itself, 	but if you were to print something like &#8220;{$a},000,000 mln 	dollars&#8221;, then you definitely need to use the braces.</p>
</li>
<li>
<p style="margin-bottom: 0cm;"><strong>How do you define a constant?</strong> -</p>
<p style="margin-bottom: 0cm;">We can do this by  define() directive, 	like <code><span style="color: #0000bb;">define</span></code><code><span style="color: #007700;">(</span></code><code><span style="color: #dd0000;">"ROOT"</span></code><code><span style="color: #007700;">, </span></code><code><span style="color: #dd0000;">"localhost"</span></code><code><span style="color: #007700;">); </span></code> and A valid constant name starts with a letter or underscore, 	followed by any number of letters, numbers, or underscores.</p>
</li>
<li>
<p style="margin-bottom: 0cm;"><strong>How do you pass a variable by 	value?</strong> -</p>
<p style="margin-bottom: 0cm;">As we do in  C++, place  an ampersand 	in front of it, like $a = &amp;$b</p>
</li>
<li>
<p style="margin-bottom: 0cm;"><strong>Will comparison of string &#8220;10&#8243; 	and integer 11 work in PHP? </strong>-</p>
<p style="margin-bottom: 0cm;">Yes, internally PHP will cast 	everything to the integer type, so numbers 10 and 11 will be 	compared.</p>
</li>
<li>
<p style="margin-bottom: 0cm;"><strong>When are you supposed to use 	endif to end the conditional statement?</strong></p>
<p style="margin-bottom: 0cm;">When the original if was followed 	by : and then the code block without braces.</p>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.webburners.com/2009/04/interview-questions-for-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
