<?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>PHP Interview Questions and answers&#187; Advanced level Archives  &#8211; interview questions and answers</title>
	<atom:link href="http://www.phpinterviewquestions.com/category/php-interview-questions/advanced-level-php-interview-questions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpinterviewquestions.com</link>
	<description>Prepare for your next php based interview with high confidence</description>
	<lastBuildDate>Mon, 26 Sep 2011 08:37:10 +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>What is the use of &#8220;Final class&#8221; and can a final class be an abstract?</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/what-is-the-use-of-final-class-and-can-a-final-class-be-an-abstract/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/what-is-the-use-of-final-class-and-can-a-final-class-be-an-abstract/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 10:46:32 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[abstract class]]></category>
		<category><![CDATA[oop]]></category>

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

The &#8220;Final&#8221; keyword is used to make the class uninheritable. So the class or it&#8217;s methods can not be overridden.

final class Class1 {
    // ...
}

class FatalClass extends Class1 {
    // ...
}

$out= new FatalClass();

An Abstract class will never be a final class as an abstract class must be extendable. 
]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 468x60, created 1/27/11 text only */
google_ad_slot = "3922180179";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
The &#8220;Final&#8221; keyword is used to make the class uninheritable. So the class or it&#8217;s methods can not be overridden.</p>
<pre class="brush: php;">
final class Class1 {
    // ...
}

class FatalClass extends Class1 {
    // ...
}

$out= new FatalClass();
</pre>
<p>An Abstract class will never be a final class as an abstract class must be extendable. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/what-is-the-use-of-final-class-and-can-a-final-class-be-an-abstract/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php security interview questions</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/php-security-interview-questions/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/php-security-interview-questions/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 11:11:55 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[php security]]></category>
		<category><![CDATA[register global]]></category>

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

Consider the following code snippet. Is this code acceptable from a security standpoint?
Assume that the $action and $data variables are designed to be accepted from the user and
register_globals is enabled.

&#60;?php
if(isUserAdmin()) {
 $isAdmin = true;
}
$data = validate_and_return_input($data);
switch($action){
 case 'add':
 addSomething($data);
 break;
case 'delete':
 if($isAdmin) {
 deleteSomething($data);
 }
break;
case 'edit':
 if($isAdmin) {
 editSomething($data);
 }
break;
default:
print â€œBad Action.â€;
}
?&#62;

A. Yes, it is [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 336x280, created 3/4/10 */
google_ad_slot = "4291231574";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Consider the following code snippet. Is this code acceptable from a security standpoint?<br />
Assume that the $action and $data variables are designed to be accepted from the user and<br />
register_globals is enabled.</p>
<pre class="brush: php;">
&lt;?php
if(isUserAdmin()) {
 $isAdmin = true;
}
$data = validate_and_return_input($data);
switch($action){
 case 'add':
 addSomething($data);
 break;
case 'delete':
 if($isAdmin) {
 deleteSomething($data);
 }
break;
case 'edit':
 if($isAdmin) {
 editSomething($data);
 }
break;
default:
print â€œBad Action.â€;
}
?&gt;
</pre>
<p>A. Yes, it is secure. It checks for $isAdmin to be True before executing protected operations<br />
B. No, it is not secure because it doesnâ€™t make sure $action is valid input<br />
<strong>C. No, it is not secure because $isAdmin can be hijacked by exploiting register_globals</strong><br />
D. Yes, it is secure because it validates the user-data $data<br />
E. Both A and B</p>
<p>The correct answer is C. This code is, by any means, not secure! In fact, it is the classic security exploit of PHP scripts using the register_globals configuration directive. The problem lies in the $isAdmin variable: although this is clearly a Boolean value, it is only set in the event that the user is an Admin and not set at all if the user is not. Because register_globals is enabled, by simply appending that variable to the end of the URL as a GET parameter, a malicious user could easily impersonate an administrator:</p>
<p>http://www.example.com/action.php?action=delete&#038;data=foo&#038;isAdmin=1</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/php-security-interview-questions/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>String Concatenation and regular expressions</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/string-concatenation-and-regular-expressions/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/string-concatenation-and-regular-expressions/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 12:08:24 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[Regular Expressions]]></category>
		<category><![CDATA[Strings]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=273</guid>
		<description><![CDATA[Following question were asked in a technical php interview question paper
Which of the following will not combine strings $s1 and $s2 into a single string?

$s1 = 'a';
$s2 = 'b';
A. $s1 + $s2
B. "{$s1}{$s2}"
C. $s1.$s2
D. implode('', array($s1,$s2))
E. All of the above combine the strings
You can not concatenate 2 string using &#8220;+&#8221;. The answer will be &#8220;0&#8243;; [...]]]></description>
			<content:encoded><![CDATA[<p>Following question were asked in a technical php interview question paper</p>
<p>Which of the following <strong>will not</strong> combine strings $s1 and $s2 into a single string?</p>
<blockquote><p><code><br />
$s1 = 'a';<br />
$s2 = 'b';<br />
A. $s1 + $s2<br />
B. "{$s1}{$s2}"<br />
C. $s1.$s2<br />
D. implode('', array($s1,$s2))<br />
E. All of the above combine the strings</code></p></blockquote>
<p>You can not concatenate 2 string using &#8220;+&#8221;. The answer will be &#8220;0&#8243;; so here the answer is A.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 336x280, created 3/4/10 */
google_ad_slot = "4291231574";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/string-concatenation-and-regular-expressions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strings and Regular Expressions</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/strings-and-regular-expressions/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/strings-and-regular-expressions/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 12:03:52 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[Strings]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=265</guid>
		<description><![CDATA[Consider the following script. What line of code should be inserted in the marked location in
order to display the string php when this script is executed?

$alpha = 'abcdefghijklmnopqrstuvwxyz';
$letters = array(15, 7, 15);
foreach($letters as $val) {
/* What should be here */
}
A. echo chr($val);
B. echo asc($val);
C. echo substr($alpha, $val, 2);
D. echo $alpha{$val};
E. echo $alpha{$val+1}

An array can be [...]]]></description>
			<content:encoded><![CDATA[<p>Consider the following script. What line of code should be inserted in the marked location in<br />
order to display the string php when this script is executed?</p>
<pre class="brush: php;">
$alpha = 'abcdefghijklmnopqrstuvwxyz';
$letters = array(15, 7, 15);
foreach($letters as $val) {
/* What should be here */
}</pre>
<p>A. echo chr($val);<br />
B. echo asc($val);<br />
C. echo substr($alpha, $val, 2);<br />
<strong>D. echo $alpha{$val};</strong><br />
E. echo $alpha{$val+1}<br />
<br />
An array can be accessed like this as well. $alpha{$val}<br />
<br />
<script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 336x280, created 3/4/10 */
google_ad_slot = "4291231574";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/strings-and-regular-expressions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>heredoc syntax</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/heredoc-syntax/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/heredoc-syntax/#comments</comments>
		<pubDate>Tue, 18 May 2010 00:28:50 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[Strings]]></category>
		<category><![CDATA[syntax]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=256</guid>
		<description><![CDATA[&#8220;heredoc&#8221; syntax can be used to declare complex strings,
What will out put the following code snippet?
&#60;?php
$who = &#34;questions&#34;;
echo &#60;&#60;&#60;TEXT
So I said, &#34;php interview $who&#34;
TEXT;
?&#62;
Answer &#8211; So I said, &#8220;php interview questions&#8221;
In general, the functionality of this heredoc syntax is similar to double quotes. 




]]></description>
			<content:encoded><![CDATA[<p>&#8220;heredoc&#8221; syntax can be used to declare complex strings,</p>
<p>What will out put the following code snippet?</p>
<pre class="brush: php;">&lt;?php
$who = &quot;questions&quot;;
echo &lt;&lt;&lt;TEXT
So I said, &quot;php interview $who&quot;
TEXT;
?&gt;</pre>
<p>Answer &#8211; So I said, &#8220;php interview questions&#8221;</p>
<p>In general, the functionality of this heredoc syntax is similar to double quotes. </p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 468x15, created 4/16/10 */
google_ad_slot = "1994287074";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/heredoc-syntax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>strings and variable interpolation</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/strings-and-variable-interpolation/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/strings-and-variable-interpolation/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 13:00:46 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[Strings]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=221</guid>
		<description><![CDATA[Basically there are 2 methods how we can define strings,
- Simple strings
- Complex strings
In a php interview, even a well experienced php programmer might forget how this works,
For an example,
a) echo &#8220;Hello $what\n&#8221;;
b) echo &#8216;Hello $what\n&#8217;;
$what = &#8220;World&#8221;;
Which will print correctly in to the browser as &#8220;Hello World&#8221; followed by a new line.
Is it a) [...]]]></description>
			<content:encoded><![CDATA[<p>Basically there are 2 methods how we can define strings,<br />
- Simple strings<br />
- Complex strings</p>
<p>In a php interview, even a well experienced php programmer might forget how this works,<br />
For an example,<br />
<strong>a) echo &#8220;Hello $what\n&#8221;;<br />
b) echo &#8216;Hello $what\n&#8217;;</strong><br />
$what = &#8220;World&#8221;;</p>
<p>Which will print correctly in to the browser as &#8220;Hello World&#8221; followed by a new line.<br />
Is it a) or b) ?<br />
<script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 468x15, created 4/16/10 */
google_ad_slot = "1994287074";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>The answer is &#8220;a&#8221;. That is because simple string will print almost all characters literally, where complex string allows special escape sequences to insert special characters.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 336x280, created 3/4/10 */
google_ad_slot = "4291231574";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/strings-and-variable-interpolation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic object oriented programming</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/basic-object-oriented-programming/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/basic-object-oriented-programming/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 06:34:02 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[oop]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=133</guid>
		<description><![CDATA[Basic object orientation in php]]></description>
			<content:encoded><![CDATA[<p>In a general php technical interview, they will ask basic OOP questions like follows, where a high skilled programmer also might get confused sometimes, if he does not know the basics.</p>
<p>class a{<br />
function a(){<br />
echo &#8216;aaaa&#8217;;<br />
}<br />
}</p>
<p>class b extends a{<br />
function b(){<br />
echo &#8216;bbbb&#8217;;<br />
parent::a();<br />
}<br />
}<br />
new b;</p>
<p>The basic idea what we have to identify in this code snippet is,Â  whether the function names work as constructors or not?<br />
Yes, first it will call the function b and then it will call the function a. Which will out put,<br />
<em>bbbbaaaa</em></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 468x15, created 4/16/10 */
google_ad_slot = "1994287074";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/basic-object-oriented-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sorting arrays</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/sorting-arrays-2/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/sorting-arrays-2/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 00:54:39 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[arrays]]></category>
		<category><![CDATA[sort]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=91</guid>
		<description><![CDATA[Both sort() and asort() is used to sort values in ascending order.To sort them in descending order what are the functions that we can use?
rsort() &#8211; Where it resets key associations as well.
arsort() &#8211; Where it sorts in descending order, while keeping the key associations as well.




]]></description>
			<content:encoded><![CDATA[<p>Both sort() and asort() is used to sort values in ascending order.To sort them in descending order what are the functions that we can use?</p>
<p>rsort() &#8211; Where it resets key associations as well.<br />
arsort() &#8211; Where it sorts in descending order, while keeping the key associations as well.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 468x15, created 4/16/10 */
google_ad_slot = "1994287074";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/sorting-arrays-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Array sorting</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/array-sorting/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/array-sorting/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 00:44:51 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[arrays]]></category>
		<category><![CDATA[sort]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=87</guid>
		<description><![CDATA[What is the difference between sort() and asort()?
The main difference is that sort() will sort an array without concerning it&#8217;s key associations while asort() will maintain it&#8217;s key association as well.




]]></description>
			<content:encoded><![CDATA[<p>What is the difference between sort() and asort()?</p>
<p>The main difference is that sort() will sort an array without concerning it&#8217;s key associations while asort() will maintain it&#8217;s key association as well.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 468x15, created 4/16/10 */
google_ad_slot = "1994287074";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/array-sorting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sorting arrays</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/sorting-arrays/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/sorting-arrays/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 00:38:23 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[arrays]]></category>
		<category><![CDATA[sort]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=85</guid>
		<description><![CDATA[What is the best way to sort an array by maintaining it&#8217;s key associations as well?
$array = array(&#8216;a&#8217;=>&#8217;foo&#8217;,'b&#8217;=>&#8217;bar&#8217;,'c&#8217;=>&#8217;baz&#8217;);
asort($array);
print_r($array);
Array
(
    [b] => bar
     => baz
    [a] => foo
)




]]></description>
			<content:encoded><![CDATA[<p>What is the best way to sort an array by maintaining it&#8217;s key associations as well?</p>
<p>$array = array(&#8216;a&#8217;=>&#8217;foo&#8217;,'b&#8217;=>&#8217;bar&#8217;,'c&#8217;=>&#8217;baz&#8217;);<br />
asort($array);<br />
print_r($array);</p>
<p>Array<br />
(<br />
    [b] => bar<br />
     => baz<br />
    [a] => foo<br />
)</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 468x15, created 4/16/10 */
google_ad_slot = "1994287074";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/sorting-arrays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Form Hijacking</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/php-form-hijacking/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/php-form-hijacking/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 17:44:42 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[hijacking]]></category>
		<category><![CDATA[sql injections]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=54</guid>
		<description><![CDATA[What are the steps that you can take to prevent form hijacking in PHP?
- Make register_globals to off to prevent Form Injection with malicious data.
- Set Error_reporting to E_ALL so that all variables will be intialized before using them.
- Practice of using htmlentities(), strip_tags(), utf8_decode() and addslashes()Â  for filtering malicious data in php
- Make practice [...]]]></description>
			<content:encoded><![CDATA[<p>What are the steps that you can take to prevent form hijacking in PHP?</p>
<p>- Make register_globals to off to prevent Form Injection with malicious data.</p>
<p>- Set Error_reporting to E_ALL so that all variables will be intialized before using them.</p>
<p>- Practice of using htmlentities(), strip_tags(), utf8_decode() and addslashes()Â  for filtering malicious data in php</p>
<p>- Make practice of using mysql_escape_string() in mysql.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 468x15, created 4/16/10 */
google_ad_slot = "1994287074";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/php-form-hijacking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Session_register and $_session</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/advanced-level-php-interview-questions/session_register-and-_session/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/advanced-level-php-interview-questions/session_register-and-_session/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 05:19:03 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>
		<category><![CDATA[register]]></category>
		<category><![CDATA[sessions]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/wordpress/?p=15</guid>
		<description><![CDATA[What is the difference between session_register and $_session? 
session_register() is used for register one or more global variables with the current session. While $_SESSION[] array is used for storing one or more variables with in the current session array. session_register() depends upon register_global is enable
]]></description>
			<content:encoded><![CDATA[<p>What is the difference between session_register and $_session? </p>
<p>session_register() is used for register one or more global variables with the current session. While $_SESSION[] array is used for storing one or more variables with in the current session array. session_register() depends upon register_global is enable</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/advanced-level-php-interview-questions/session_register-and-_session/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Number of rows in a results set</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/advanced-level-php-interview-questions/number-of-rows-in-a-results-set/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/advanced-level-php-interview-questions/number-of-rows-in-a-results-set/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 10:49:03 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>
		<category><![CDATA[resultset]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/wordpress/?p=24</guid>
		<description><![CDATA[How can we find the number of rows in a result set using PHP?
$result = mysql_query($any_valid_sql, $database_link);
$num_rows = mysql_num_rows($result);
echo â€œ$num_rows rows foundâ€;
]]></description>
			<content:encoded><![CDATA[<p>How can we find the number of rows in a result set using PHP?</p>
<p>$result = mysql_query($any_valid_sql, $database_link);<br />
$num_rows = mysql_num_rows($result);<br />
echo â€œ$num_rows rows foundâ€;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/advanced-level-php-interview-questions/number-of-rows-in-a-results-set/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql Connection</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/advanced-level-php-interview-questions/mysql-connection/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/advanced-level-php-interview-questions/mysql-connection/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 10:49:03 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/wordpress/?p=26</guid>
		<description><![CDATA[What is difference between mysql_connect and mysql_pconnect?
mysql_pconnect establishes a persistent connection. If you don&#8217;t need one (such as a website that is mostly HTML files or PHP files that don&#8217;t call the db) then you don&#8217;t need to use it. mysql_connect establishes a connection for the duration of the script that access the db. Once [...]]]></description>
			<content:encoded><![CDATA[<p>What is difference between mysql_connect and mysql_pconnect?</p>
<p>mysql_pconnect establishes a persistent connection. If you don&#8217;t need one (such as a website that is mostly HTML files or PHP files that don&#8217;t call the db) then you don&#8217;t need to use it. mysql_connect establishes a connection for the duration of the script that access the db. Once the script has finished executing it closes the connection. The only time you need to close the connection manually is</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/advanced-level-php-interview-questions/mysql-connection/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MYSQL Result Set</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/advanced-level-php-interview-questions/mysql-result-set/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/advanced-level-php-interview-questions/mysql-result-set/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 05:19:03 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>
		<category><![CDATA[resultset]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/wordpress/?p=30</guid>
		<description><![CDATA[How many ways can we used to retrieve data in a result set of mysql using php?
   1. Using mysql_fetch_row function. This will return an indexed array.
   2. Using mysql_fetch_array function. Fetch a result row as an associative array, a numeric array, or both.
   3. Using mysql_fetch_object function. This [...]]]></description>
			<content:encoded><![CDATA[<p>How many ways can we used to retrieve data in a result set of mysql using php?</p>
<p>   1. Using mysql_fetch_row function. This will return an indexed array.<br />
   2. Using mysql_fetch_array function. Fetch a result row as an associative array, a numeric array, or both.<br />
   3. Using mysql_fetch_object function. This will return the result set as an object.<br />
   4. Using mysql_fetch_assoc function. This will Fetch a result row as an associative array</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/advanced-level-php-interview-questions/mysql-result-set/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

