<?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-34762507</id><updated>2011-12-13T19:52:55.033-08:00</updated><title type='text'>Php Mania</title><subtitle type='html'>A Techincal Blog on solutions and knowledge about PHP / HTML / JavaScript / Linux / AJAX.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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>55</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-34762507.post-5498494072399640320</id><published>2011-02-10T23:17:00.000-08:00</published><updated>2011-02-10T23:19:09.404-08:00</updated><title type='text'>About ExpressionEngine [EE]</title><content type='html'>Expression Engine is a very powerful content management system that can be used to manage your website and blog. All you have to do is add EE tags into the portions of your pages where you want your posts / content to appear. It has all the inbuilt basic features that is required to create a website. However, for more complex implementation you would need to buy / get free add-ons or hack the code to suit your needs.&lt;br /&gt;&lt;br /&gt;Fetching and displaying the data is an easy part. Challenge comes in when you want to display it in a more creative way.&lt;br /&gt;&lt;br /&gt;Like at one such instance, we needed a feature to add ratings for an article and at the same time add customer's review. To achieve this we simply made changes to the add-on's class file, added a field to the ratings table in the database to store the reviews as well as the score, since we wanted to display the customers review for the article along with the rating. &lt;br /&gt;&lt;br /&gt;Second, displaying breadcrumbs in a customized way. Though there are add-ons available for the same, but add-on's displayed the breadcrumbs based on the query string. So, we had to modify the class file to suit our requirements.&lt;br /&gt;&lt;br /&gt;Third, in certain cases there were limitations to using EE tags, particularly nested "weblog" tags. To overcome such situations we have used queries instead to fetch the required data for further processing in the inner loops.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Conclusion&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So, unlike learning any new application especially content management systems, learning EE was comparatively less painful. The more you work on it, the more you discover about its potential. Be it a usual CMS site, Shopping Carts, Blogs etc. EE&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-5498494072399640320?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/5498494072399640320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=5498494072399640320' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/5498494072399640320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/5498494072399640320'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2011/02/about-expressionengine-ee.html' title='About ExpressionEngine [EE]'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-3188977042038494919</id><published>2011-02-10T23:09:00.000-08:00</published><updated>2011-02-10T23:34:19.346-08:00</updated><title type='text'>How to get next auto increment value of a primary key field in MySql?</title><content type='html'>&amp;lt;?php&lt;br /&gt;function mysql_next_id($table) {&lt;br /&gt;    $result = mysql_query('SHOW TABLE STATUS LIKE "'.$table.'"');&lt;br /&gt;    $rows = mysql_fetch_assoc($result);&lt;br /&gt;    return $rows['auto_increment'];&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;Programmers try other ways to retrieve the next auto-generated id and fail to get correct value.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;Most of the programmers try to get the MAX(id)+1 (or sort the table in decending order and get the first id) but this will not to work when you delete the last record.&lt;br /&gt;&lt;br /&gt;There is a possibility that other users have entered record in the meantime, in this case the value that you have retrieved would be incorrect. You may use LOCK TABLES to prevent such a case.&lt;br /&gt;&lt;br /&gt;However, the best thing is to avoid such logics.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-3188977042038494919?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/3188977042038494919/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=3188977042038494919' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/3188977042038494919'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/3188977042038494919'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2011/02/how-to-get-next-auto-increment-value-of.html' title='How to get next auto increment value of a primary key field in MySql?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-4669041095531747937</id><published>2009-11-18T07:15:00.003-08:00</published><updated>2009-11-18T07:15:46.888-08:00</updated><title type='text'>What are the various methods to pass data from one web page to another web page ?</title><content type='html'>Below are the ways to pass data acros the pages:&lt;br /&gt;&lt;br /&gt;1.POST&lt;br /&gt;2.GET&lt;br /&gt;3.SESSION&lt;br /&gt;4.COOKIES&lt;br /&gt;5.QUERY STRING&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-4669041095531747937?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/4669041095531747937/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=4669041095531747937' title='39 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/4669041095531747937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/4669041095531747937'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/11/what-are-various-methods-to-pass-data.html' title='What are the various methods to pass data from one web page to another web page ?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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>39</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34762507.post-8333423244242313571</id><published>2009-11-18T07:15:00.001-08:00</published><updated>2009-11-18T07:15:29.261-08:00</updated><title type='text'>What is a Zend Engine?</title><content type='html'>The Zend Engine is an open source scripting engine (a Virtual Machine), commonly known for the important role it plays in the web automation language PHP.&lt;br /&gt;&lt;br /&gt;The current version of the virtual machine is The Zend Engine II and is at the heart of PHP 5.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-8333423244242313571?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/8333423244242313571/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=8333423244242313571' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/8333423244242313571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/8333423244242313571'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/11/what-is-zend-engine.html' title='What is a Zend Engine?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-3927593770321799544</id><published>2009-11-18T07:14:00.004-08:00</published><updated>2009-11-18T07:15:12.076-08:00</updated><title type='text'>What are the types of Storage Engines MySQL supports?</title><content type='html'>MySQL supports several storage engines that act as handlers for different table types. MySQL storage engines include both those that handle transaction-safe tables and those that handle nontransaction-safe tables.&lt;br /&gt;&lt;br /&gt;To determine which storage engines your server supports by using the SHOW ENGINES statement. The value in the Support column indicates whether an engine can be used. A value of YES, NO, or DEFAULT indicates that an engine is available, not available, or avaiable and current set as the default storage engine.&lt;br /&gt;&lt;br /&gt;MySQL 5.1 supported storage engines&lt;br /&gt;&lt;br /&gt;1. MyISAM ? The default MySQL storage engine and the one that is used the most in Web, data warehousing, and other application environments. MyISAM is supported in all MySQL configurations, and is the default storage engine unless you have configured MySQL to use a different one by default.&lt;br /&gt;&lt;br /&gt;2. InnoDB ? A transaction-safe (ACID compliant) storage engine for MySQL that has commit, rollback, and crash-recovery capabilities to protect user data. InnoDB row-level locking (without escalation to coarser granularity locks) and Oracle-style consistent nonlocking reads increase multi-user concurrency and performance. InnoDB stores user data in clustered indexes to reduce I/O for common queries based on primary keys. To maintain data integrity, InnoDB also supports FOREIGN KEY referential-integrity constraints.&lt;br /&gt;&lt;br /&gt;3. Memory ? Stores all data in RAM for extremely fast access in environments that require quick lookups of reference and other like data. This engine was formerly known as the HEAP engine.&lt;br /&gt;    &lt;br /&gt;4. Merge ? Allows a MySQL DBA or developer to logically group a series of identical MyISAM tables and reference them as one object. Good for VLDB environments such as data warehousing.&lt;br /&gt;   &lt;br /&gt;5. Archive ? Provides the perfect solution for storing and retrieving large amounts of seldom-referenced historical, archived, or security audit information.&lt;br /&gt;&lt;br /&gt;6. Federated ? Offers the ability to link separate MySQL servers to create one logical database from many physical servers. Very good for distributed or data mart environments.&lt;br /&gt;    &lt;br /&gt;7. NDBCLUSTER (also known as NDB) ? This clustered database engine is particularly suited for applications that require the highest possible degree of uptime and availability.&lt;br /&gt;&lt;br /&gt;8. CSV ? The CSV storage engine stores data in text files using comma-separated values format. You can use the CSV engine to easily exchange data between other software and applications that can import and export in CSV format.&lt;br /&gt;    &lt;br /&gt;9. Blackhole ? The Blackhole storage engine accepts but does not store data and retrievals always return an empty set. The functionality can be used in distributed database design where data is automatically replicated, but not stored locally.&lt;br /&gt;    &lt;br /&gt;10. Example ? The Example storage engine is ?stub? engine that does nothing. You can create tables with this engine, but no data can be stored in them or retrieved from them. The purpose of this engine is to serve as an example in the MySQL source code that illustrates how to begin writing new storage engines. As such, it is primarily of interest to developers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-3927593770321799544?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/3927593770321799544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=3927593770321799544' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/3927593770321799544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/3927593770321799544'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/11/what-are-types-of-storage-engines-mysql.html' title='What are the types of Storage Engines MySQL supports?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-7233254287384436998</id><published>2009-11-18T07:14:00.003-08:00</published><updated>2009-11-18T07:14:51.328-08:00</updated><title type='text'>What type of inheritance that php supports?</title><content type='html'>PHP support the Multilevel inheritance Not a multiple inheritance.&lt;br /&gt;&lt;br /&gt; For Example:&lt;br /&gt;&lt;br /&gt;class A{&lt;br /&gt;&lt;br /&gt;function hello();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// This is possible.&lt;br /&gt;class B extends A{&lt;br /&gt;&lt;br /&gt;function helloB();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// This is not possible, IT gives the fatal error.&lt;br /&gt;class C extends A{&lt;br /&gt;&lt;br /&gt;function helloC();&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-7233254287384436998?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/7233254287384436998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=7233254287384436998' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/7233254287384436998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/7233254287384436998'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/11/what-type-of-inheritance-that-php.html' title='What type of inheritance that php supports?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-481811176015187377</id><published>2009-11-18T07:14:00.001-08:00</published><updated>2009-11-18T07:14:32.189-08:00</updated><title type='text'>Where Is Session Data Stored?</title><content type='html'>Sessions work by creating a unique id (UID) for each visitor and store variables based on this UID. The UID is either stored in a cookie or is propagated in the URL.&lt;br /&gt;The most significant differences between the two are that cookies are stored on the client, while the session data is stored on the server.  As a result, sessions are more secure than cookies (no information is being sent back and forth between the client and the server) and sessions work even when the user has disabled cookies in their browser.  Cookies, on the other hand, can be used to track information even from one session to another by setting it's time( ) parameter&lt;br /&gt;&lt;br /&gt;The session.save_path setting specifies the directory name for session data.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-481811176015187377?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/481811176015187377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=481811176015187377' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/481811176015187377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/481811176015187377'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/11/where-is-session-data-stored.html' title='Where Is Session Data Stored?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-8437965392267415341</id><published>2009-11-18T07:13:00.006-08:00</published><updated>2009-11-18T07:14:16.614-08:00</updated><title type='text'>What is the purpose of ob_start() ?</title><content type='html'>This function will turn output buffering on. While output buffering is active no output is sent from the script (other than headers), instead the output is stored in an internal buffer.&lt;br /&gt;&lt;br /&gt;The contents of this internal buffer may be copied into a string variable using ob_get_contents(). To output what is stored in the internal buffer, use ob_end_flush(). Alternatively, ob_end_clean() will silently discard the buffer contents. &lt;br /&gt;&lt;br /&gt;Output buffers are stackable, that is, you may call ob_start() while another ob_start() is active. Just make sure that you call ob_end_flush()  the appropriate number of times. If multiple output callback functions are active, output is being filtered sequentially through each of them in nesting order.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-8437965392267415341?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/8437965392267415341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=8437965392267415341' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/8437965392267415341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/8437965392267415341'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/11/what-is-purpose-of-obstart.html' title='What is the purpose of ob_start() ?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-5625997830862087145</id><published>2009-11-18T07:13:00.005-08:00</published><updated>2009-11-18T07:13:55.874-08:00</updated><title type='text'>What are new features that are in added in PHP5?</title><content type='html'>Following are new features added in PHP5&lt;br /&gt;&lt;br /&gt;1. PHP 5 introduces the Standard PHP Library (SPL) which provides a number of ready-made classes and interfaces.&lt;br /&gt;2. Access Modifiers are added in PHP5&lt;br /&gt;3. PHP5 has built-in exception classes that makes it very easy to create your own customized exceptions through inheritance.&lt;br /&gt;4. PHP 5 introduces the mysqli (MySQL Improved) extension with support for the features of MySQL databases versions 4.1 and higher. So use of prepare statements are allowed&lt;br /&gt;5. PHP5 comes with PDO which is a common interface for different database systems is only made possible by the new object model.&lt;br /&gt;6. SQLite is a database engine incorporated in php5 which can be used to develope faster leaner and more versatile applications.&lt;br /&gt;7. In PHP 5 all Extensible Markup Language (XML) support is provided by the libxml2 XML toolkit.&lt;br /&gt;8. The reflection classes included in PHP 5 provide ways to introspect objects and reverse engineer code.&lt;br /&gt;9. In addition to built-in classes PHP 5 also offers built-in interfaces. Iterator is the most important as a number of classes and interfaces are derived from this interface.&lt;br /&gt;10. PHP 5 introduces a number of new "magic" methods. Magic methods begin with a double underscore and this requires changing any user-defined methods or functions that use this naming convention.&lt;br /&gt;11. The major change to PHP in version 5 relating to OOP is usually summed up by saying that objects are now passed by reference.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-5625997830862087145?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/5625997830862087145/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=5625997830862087145' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/5625997830862087145'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/5625997830862087145'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/11/what-are-new-features-that-are-in-added.html' title='What are new features that are in added in PHP5?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-2285442572299161612</id><published>2009-11-18T07:13:00.003-08:00</published><updated>2009-11-18T07:13:38.942-08:00</updated><title type='text'>What is the difference between session_register() and $_SESSION?</title><content type='html'>Following are differences between session_register and $_SESSION&lt;br /&gt;&lt;br /&gt;1. session_register function returns boolean value, whereas $_SESSION returns string value.&lt;br /&gt;&lt;br /&gt;2. session_register function does'nt work if register_global is disabled. $_SESSION works in both case whether register_global is disabled or enabled. &lt;br /&gt;So using $_SESSION for session variable manipulation is more appropriate.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-2285442572299161612?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/2285442572299161612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=2285442572299161612' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/2285442572299161612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/2285442572299161612'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/11/what-is-difference-between.html' title='What is the difference between session_register() and $_SESSION?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-4675398580581821725</id><published>2009-11-18T07:13:00.001-08:00</published><updated>2009-11-18T07:13:22.719-08:00</updated><title type='text'>Which will execute faster POST or GET? Explain</title><content type='html'>POST is most secure so it have to pass some process. GET is simple way to send via URL so it is will be fast.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-4675398580581821725?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/4675398580581821725/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=4675398580581821725' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/4675398580581821725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/4675398580581821725'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/11/which-will-execute-faster-post-or-get.html' title='Which will execute faster POST or GET? Explain'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-7789257725382277382</id><published>2009-11-18T07:12:00.001-08:00</published><updated>2009-11-18T07:12:56.597-08:00</updated><title type='text'>What is the difference between echo and print statement?</title><content type='html'>Both echo and print are language constructs.&lt;br /&gt;&lt;br /&gt;However print() acts like a function in that it returns a value and can be used in complex expressions.&lt;br /&gt;&lt;br /&gt;Furthermore echo without parentheses can take multiple arguments. Echo with parentheses and print can only take a single argument.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-7789257725382277382?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/7789257725382277382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=7789257725382277382' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/7789257725382277382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/7789257725382277382'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/11/what-is-difference-between-echo-and.html' title='What is the difference between echo and print statement?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-8641828922556749736</id><published>2009-11-18T07:11:00.000-08:00</published><updated>2009-11-18T07:12:09.032-08:00</updated><title type='text'>How to upload the file from one server to Remote server?</title><content type='html'>$fileToBeUploaded = "filename.txt";&lt;br /&gt;&lt;br /&gt;$source = fopen($fileToBeUploaded,"r");&lt;br /&gt;$conn = ftp_connect("ftp.myserver.com");&lt;br /&gt;ftp_login($conn,"&lt;ftp_username&gt;","&lt;ftp_password&gt;");&lt;br /&gt;&lt;br /&gt;ftp_fput($conn,"/path_to_folder_on_remote_server/newfile.txt",$source,FTP_ASCII);&lt;br /&gt;&lt;br /&gt;ftp_close($conn);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-8641828922556749736?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/8641828922556749736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=8641828922556749736' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/8641828922556749736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/8641828922556749736'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/11/how-to-upload-file-from-one-server-to.html' title='How to upload the file from one server to Remote server?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-1294412583669603748</id><published>2009-10-21T08:42:00.000-07:00</published><updated>2009-10-21T08:44:17.868-07:00</updated><title type='text'>Code for "Bookmark Us" in Javascript</title><content type='html'>Place the following script into your &amp;lt;head&amp;gt;section in the page you need to use it:&lt;br /&gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&lt;br /&gt;function bookmark_us(url, title){&lt;br /&gt;&lt;br /&gt;if (window.sidebar) // firefox&lt;br /&gt;    window.sidebar.addPanel(title, url, "");&lt;br /&gt;else if(window.opera &amp;&amp; window.print){ // opera&lt;br /&gt;    var elem = document.createElement('a');&lt;br /&gt;    elem.setAttribute('href',url);&lt;br /&gt;    elem.setAttribute('title',title);&lt;br /&gt;    elem.setAttribute('rel','sidebar');&lt;br /&gt;    elem.click();&lt;br /&gt;}&lt;br /&gt;else if(document.all)// ie&lt;br /&gt;    window.external.AddFavorite(url, title);&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;Next, place the following code in order to show the link that opens browser's bookmark window:&lt;br /&gt;&lt;br /&gt;&amp;lt;a href="javascript:bookmark_us('http://phpcoders.blogspot.com/','Php Coders')"&amp;gt;Bookmark us!&amp;lt;/a&amp;gt;&lt;br /&gt;&lt;br /&gt;That is all! You have now a full working bookmark us script.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-1294412583669603748?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/1294412583669603748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=1294412583669603748' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/1294412583669603748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/1294412583669603748'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/10/code-for-bookmark-us-in-javascript.html' title='Code for &quot;Bookmark Us&quot; in Javascript'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-5502220426267953564</id><published>2009-10-21T08:38:00.000-07:00</published><updated>2009-10-21T08:39:19.177-07:00</updated><title type='text'>JavaScript Wait While Loading Page Display Image</title><content type='html'>If you have a page that takes long time to display it is a good idea to display a "wait until the page loads" image. This tutorial show you how to implement this in your webpage.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Below are the steps to implement the feature:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Step 1. Every time your page loads a "init()" function will load.&lt;br /&gt;&lt;br /&gt;&amp;lt;body onLoad="init()"&amp;gt;&lt;br /&gt;&lt;br /&gt;Step 2. Define a div named "loading" right after &amp;lt;body&amp;gt; section.&lt;br /&gt;&lt;br /&gt;&amp;lt;div id="loading" style="position:absolute; width:100%; text-align:center; top:300px;"&amp;gt;&lt;br /&gt;&amp;lt;img src="loading.gif" border=0&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;The loading.gif image should be an animated gif that suggests that the page is still loading.&lt;br /&gt;&lt;br /&gt;Step 3. Place this javascript code right after you define the div.&lt;br /&gt;&lt;br /&gt;  &amp;lt;script&amp;gt;&lt;br /&gt; var ld=(document.all);&lt;br /&gt;  var ns4=document.layers;&lt;br /&gt; var ns6=document.getElementById&amp;&amp;!document.all;&lt;br /&gt; var ie4=document.all;&lt;br /&gt;  if (ns4)&lt;br /&gt;  ld=document.loading;&lt;br /&gt; else if (ns6)&lt;br /&gt;  ld=document.getElementById("loading").style;&lt;br /&gt; else if (ie4)&lt;br /&gt;  ld=document.all.loading.style;&lt;br /&gt;  function init()&lt;br /&gt; {&lt;br /&gt; if(ns4){ld.visibility="hidden";}&lt;br /&gt; else if (ns6||ie4) ld.display="none";&lt;br /&gt; }&lt;br /&gt; &amp;lt;/script&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-5502220426267953564?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/5502220426267953564/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=5502220426267953564' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/5502220426267953564'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/5502220426267953564'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/10/javascript-wait-while-loading-page.html' title='JavaScript Wait While Loading Page Display Image'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-5088548809850215348</id><published>2009-10-21T08:30:00.000-07:00</published><updated>2009-10-21T08:35:11.740-07:00</updated><title type='text'>How to diable Right Click in JavaScript?</title><content type='html'>Neat code to restrict a user to right click and view the code or save an image. Though, it does not assure complete safety for your source (there is always a way to copy them), but it is better than nothing.&lt;br /&gt;&lt;br /&gt;Copy &amp; Paste this script under the HEAD in the HTML area of your webpage.&lt;br /&gt;&lt;br /&gt;&amp;lt;script&amp;gt;&lt;br /&gt;var isNS = (navigator.appName == "Netscape") ? 1 : 0;&lt;br /&gt;if(navigator.appName == "Netscape") document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);&lt;br /&gt;function mischandler(){&lt;br /&gt; return false;&lt;br /&gt;}&lt;br /&gt;function mousehandler(e){&lt;br /&gt; var myevent = (isNS) ? e : event;&lt;br /&gt; var eventbutton = (isNS) ? myevent.which : myevent.button;&lt;br /&gt; if((eventbutton==2)||(eventbutton==3)) return false;&lt;br /&gt;}&lt;br /&gt;document.oncontextmenu = mischandler;&lt;br /&gt;document.onmousedown = mousehandler;&lt;br /&gt;document.onmouseup = mousehandler;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-5088548809850215348?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/5088548809850215348/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=5088548809850215348' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/5088548809850215348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/5088548809850215348'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/10/how-to-diable-right-click-in-javascript.html' title='How to diable Right Click in JavaScript?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-3665935826927159972</id><published>2009-08-18T02:56:00.001-07:00</published><updated>2009-08-18T02:56:44.948-07:00</updated><title type='text'>How to force open a window that asks to "Open" or "Save As" the file?</title><content type='html'>Below is the working example of a code that would ask the user to "Open" or "Save" the file.&lt;br /&gt;&lt;br /&gt;Note: There should not be any output displayed above the below mentioned code i.e. the rules for "headers" in php applies here.&lt;br /&gt;&lt;br /&gt;&amp;lt;?&lt;br /&gt;$contentFilePath = "/docs/xyz.pdf"; // Specify the path to the file that needs to be downloaded. This could also be a file that is generated dynamically.&lt;br /&gt; &lt;br /&gt;if ($fd = fopen ($contentFilePath, "rb")) {&lt;br /&gt; $fsize = filesize($contentFilePath);&lt;br /&gt; $fname = basename ($contentFilePath);&lt;br /&gt; &lt;br /&gt; // Specify the required headers&lt;br /&gt; header("Pragma: ");&lt;br /&gt; header("Cache-Control: ");&lt;br /&gt; header("Content-type: application/octet-stream");&lt;br /&gt; header("Content-Disposition: attachment; filename=\"".$fname."\"");&lt;br /&gt; header("Content-length: $fsize");&lt;br /&gt; &lt;br /&gt; fpassthru($fd);&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-3665935826927159972?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/3665935826927159972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=3665935826927159972' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/3665935826927159972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/3665935826927159972'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/08/how-to-force-open-window-that-asks-to.html' title='How to force open a window that asks to &quot;Open&quot; or &quot;Save As&quot; the file?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-592959154652848453</id><published>2009-08-18T02:55:00.001-07:00</published><updated>2009-08-18T02:55:59.003-07:00</updated><title type='text'>Generate random alphanumeric password in Php</title><content type='html'>A simple function which returns an autogenerated random alphanumerical password with the specified length.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;&lt;br /&gt;&amp;lt;?&lt;br /&gt;function NewPassword($len = 8)&lt;br /&gt;{&lt;br /&gt;    $chars=array(&lt;br /&gt;                 "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P",&lt;br /&gt;                 "Q","R","S","T","U","V","W","X","Y","Z", //upper-case&lt;br /&gt;                 "a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p",&lt;br /&gt;                 "q","r","s","t","u","v","w","x","y","z", //lower-case&lt;br /&gt;                 "0","1","2","3","4","5","6","7","8","9"  //numbers&lt;br /&gt;                );&lt;br /&gt;&lt;br /&gt;    srand((float) microtime() * 10000000);&lt;br /&gt;    $array=array_rand($chars, $len);&lt;br /&gt;&lt;br /&gt;    $password="";&lt;br /&gt;    foreach ($array as $key =&amp;gt; $val)&lt;br /&gt;        $password.=$chars[$val];&lt;br /&gt;&lt;br /&gt;    return $password;&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-592959154652848453?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/592959154652848453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=592959154652848453' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/592959154652848453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/592959154652848453'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/08/generate-random-alphanumeric-password.html' title='Generate random alphanumeric password in Php'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-330293075710373668</id><published>2009-08-18T02:53:00.000-07:00</published><updated>2009-08-18T02:54:46.513-07:00</updated><title type='text'>Random password generation in Php</title><content type='html'>A simple random password generation function which generates various length (up to 32 characters) of password with numerals and alphabets.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;function genPass($length = 8) //max length = 32 characters&lt;br /&gt;{&lt;br /&gt; return substr(md5(uniqid(rand(), true)), 0, $length);&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-330293075710373668?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/330293075710373668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=330293075710373668' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/330293075710373668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/330293075710373668'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/08/random-password-generation-in-php.html' title='Random password generation in Php'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-3607222902153379358</id><published>2009-08-18T02:22:00.000-07:00</published><updated>2009-08-18T02:23:16.349-07:00</updated><title type='text'>JavaScript code to strip HTML tags</title><content type='html'>This script removes any HTML tags from user entered data such as a TEXTAREA before the form is submitted. This is generally a good idea, as HTML tags can corrupt the rest of your form contents or even pose a security risk.&lt;br /&gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&lt;br /&gt;// Strip HTML Tags (form) script- By JavaScriptKit.com (http://www.javascriptkit.com)&lt;br /&gt;// For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/&lt;br /&gt;// This notice must stay intact for use&lt;br /&gt;&lt;br /&gt;function stripHTML(){&lt;br /&gt;var re= /&amp;lt;\S[^&amp;gt;&amp;lt;]*&amp;gt;/g&lt;br /&gt;for (i=0; i&amp;lt;arguments.length; i++)&lt;br /&gt;arguments[i].value=arguments[i].value.replace(re, "")&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;form onSubmit="stripHTML(this.data1, this.data2)"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;textarea name="data1" style="width: 400px; height: 100px"&amp;gt;&amp;lt;/textarea&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;textarea name="data2" style="width: 400px; height: 100px"&amp;gt;&amp;lt;/textarea&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;input type="submit" value="submit"&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-3607222902153379358?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/3607222902153379358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=3607222902153379358' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/3607222902153379358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/3607222902153379358'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/08/javascript-code-to-strip-html-tags.html' title='JavaScript code to strip HTML tags'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-7815759256616250337</id><published>2009-08-18T02:21:00.001-07:00</published><updated>2009-08-18T02:21:57.317-07:00</updated><title type='text'>Javascript Dynamic Text Area Counter</title><content type='html'>Below is the simple code to restrict the number of characters from being entered in the Text Area.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;SCRIPT LANGUAGE="JavaScript"&amp;gt;&lt;br /&gt;function textCounter(field,cntfield,maxlimit) {&lt;br /&gt; if (field.value.length &amp;gt; maxlimit) { // Trim it if too long&lt;br /&gt;  field.value = field.value.substring(0, maxlimit);&lt;br /&gt; }&lt;br /&gt; else { // otherwise, update 'characters left' counter&lt;br /&gt;  cntfield.value = maxlimit - field.value.length;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;form name="myForm" method="post"&amp;gt;&lt;br /&gt;&amp;lt;textarea name="textArea1" wrap="physical" cols="30" rows="5" onKeyDown="textCounter(document.myForm.textArea1,document.myForm.charLeft,100)" onKeyUp="textCounter(document.myForm.textArea1,document.myForm.charLeft,100)"&amp;gt;&amp;lt;/textarea&amp;gt;&lt;br /&gt;&amp;lt;br&amp;gt;&lt;br /&gt;&amp;lt;input readonly type="text" name="charLeft" size="3" maxlength="3" value="100"&amp;gt; characters left&lt;br /&gt;&amp;lt;input type="Submit" name="Submit" value="Submit"&amp;gt;&lt;br /&gt;&amp;lt;br&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-7815759256616250337?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/7815759256616250337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=7815759256616250337' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/7815759256616250337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/7815759256616250337'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/08/javascript-dynamic-text-area-counter.html' title='Javascript Dynamic Text Area Counter'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-104865620541607128</id><published>2009-08-18T02:20:00.000-07:00</published><updated>2009-08-18T02:21:07.259-07:00</updated><title type='text'>Regular Expressions Examples</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Regular expression examples for decimals input&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Positive Integers --- ^\d+$&lt;br /&gt;Negative Integers --- ^-\d+$&lt;br /&gt;Integer --- ^-{0,1}\d+$&lt;br /&gt;Positive Number --- ^\d*\.{0,1}\d+$&lt;br /&gt;Negative Number --- ^-\d*\.{0,1}\d+$&lt;br /&gt;Positive Number or Negative Number - ^-{0,1}\d*\.{0,1}\d+$&lt;br /&gt;Phone number --- ^\+?[\d\s]{3,}$&lt;br /&gt;Phone with code --- ^\+?[\d\s]+\(?[\d\s]{10,}$&lt;br /&gt;Year 1900-2099 --- ^(19|20)[\d]{2,2}$&lt;br /&gt;Date (dd mm yyyy, d/m/yyyy, etc.) --- ^([1-9]|0[1-9]|[12][0-9]|3[01])\D([1-9]|0[1-9]|1[012])\D(19[0-9][0-9]|20[0-9][0-9])$&lt;br /&gt;IP v4 --- ^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]){3}$&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Regular expression examples for Alphabetic input&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Personal Name --- ^[\w\.\']{2,}([\s][\w\.\']{2,})+$&lt;br /&gt;Username --- ^[\w\d\_\.]{4,}$&lt;br /&gt;Password at least 6 symbols --- ^.{6,}$&lt;br /&gt;Password or empty input --- ^.{6,}$|^$&lt;br /&gt;email --- ^[\_]*([a-z0-9]+(\.|\_*)?)+@([a-z][a-z0-9\-]+(\.|\-*\.))+[a-z]{2,6}$&lt;br /&gt;domain --- ^([a-z][a-z0-9\-]+(\.|\-*\.))+[a-z]{2,6}$&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Other regular expressions&lt;/span&gt;&lt;br /&gt;Match no input --- ^$&lt;br /&gt;Match blank input --- ^\s[\t]*$&lt;br /&gt;Match New line --- [\r\n]|$&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-104865620541607128?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/104865620541607128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=104865620541607128' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/104865620541607128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/104865620541607128'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/08/regular-expressions-examples.html' title='Regular Expressions Examples'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-6400379152024765057</id><published>2009-08-18T02:17:00.000-07:00</published><updated>2009-08-18T02:19:48.822-07:00</updated><title type='text'>Generate a random password</title><content type='html'>Function will generate a random password with a default length of 8 or a user supplied length. Password will contain special characters, integers, and upper and lowercase characters.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;&lt;br /&gt;&amp;lt;?&lt;br /&gt;function newPass($maxLen=8,$pass='') {&lt;br /&gt;  srand((float) microtime() * 10000000);&lt;br /&gt;  shuffle($params=array_merge(range(0,9),range('a','z'),range('A','Z'), &lt;br /&gt;    array('$','_','+','*','!','%','#','@','&amp;','-')));&lt;br /&gt;  for($i=0;$i&lt;$maxLen;$i++) { $pass.=$params[rand(0,count($params)-1)]; }&lt;br /&gt;  unset($params);&lt;br /&gt;  return $pass;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$myNewPassword = newPass(15) # create and store a password of length 15&lt;br /&gt;# Result =&gt; QEc*I#j5#cueUcZ&lt;br /&gt;&lt;br /&gt;$myNewPassword = newPass() # create and store a password of default length 8&lt;br /&gt;?&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-6400379152024765057?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/6400379152024765057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=6400379152024765057' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/6400379152024765057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/6400379152024765057'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/08/generate-random-password.html' title='Generate a random password'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-7390560949567309650</id><published>2009-04-09T08:32:00.000-07:00</published><updated>2009-05-12T02:50:34.554-07:00</updated><title type='text'>How to implement Complex Password Validity Tester?</title><content type='html'>How to implement Complex Password Validity Tester?&lt;br /&gt;&lt;br /&gt;This can be implemented by using JavaScript code to force passwords to be a combination of alphabets and numbers and force range of characters.&lt;br /&gt;&lt;br /&gt;The below code makes sure that user enters combination of alphanumeric data and check for minimum number of chars. It checks for at least one alphabetic char, special char and one numeric chars.&lt;br /&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;script language="javascript"&amp;gt;&lt;br /&gt;function Search_Array(ArrayObj, SearchFor){&lt;br /&gt;  var Found = false;&lt;br /&gt;  for (var i = 0; i &amp;lt; ArrayObj.length; i++){&lt;br /&gt;    if (ArrayObj[i] == SearchFor){&lt;br /&gt;      return true;&lt;br /&gt;      var Found = true;&lt;br /&gt;      break;&lt;br /&gt;    }&lt;br /&gt;    else if ((i == (ArrayObj.length - 1)) &amp;&amp; (!Found)){&lt;br /&gt;      if (ArrayObj[i] != SearchFor){&lt;br /&gt;        return false;&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function isAlphabeticSequence (passwdString) {&lt;br /&gt;&lt;br /&gt; var i="0",&lt;br /&gt; lower   = "abcdefghijklmnopqrstuvwxyz",&lt;br /&gt; upper   = lower.toUpperCase(),&lt;br /&gt; numbers = "0123456789",&lt;br /&gt; badSequenceLength = 3,&lt;br /&gt; noQwertySequences = true,&lt;br /&gt; qwerty  = "qwertyuiopasdfghjklzxcvbnm",&lt;br /&gt; start   = badSequenceLength - 1,&lt;br /&gt; seq     = "_" + passwdString.slice(0, start),&lt;br /&gt; flg1=0;&lt;br /&gt; &lt;br /&gt; for (i = start; i &amp;lt; passwdString.length; i++) {&lt;br /&gt;  seq = seq.slice(1) + passwdString.charAt(i);&lt;br /&gt;  if (&lt;br /&gt;   lower.indexOf(seq)   &amp;gt; -1 ||&lt;br /&gt;   upper.indexOf(seq)   &amp;gt; -1 ||&lt;br /&gt;   numbers.indexOf(seq) &amp;gt; -1 ||&lt;br /&gt;   (noQwertySequences &amp;&amp; qwerty.indexOf(seq) &amp;gt; -1)&lt;br /&gt;  ) {&lt;br /&gt;   flg1++;&lt;br /&gt;   break;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; if (flg1 &amp;gt; 0) {&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function isAlphabeticSequenceDesc (passwdString) {&lt;br /&gt;&lt;br /&gt; var i="0",&lt;br /&gt; lower_desc   = "zyxwvutsrqponmlkjihgfedcba",&lt;br /&gt; upper_desc   = lower_desc.toUpperCase(),&lt;br /&gt; numbers_desc = "9876543210",&lt;br /&gt; badSequenceLength = 3,&lt;br /&gt; noQwertySequences = true,&lt;br /&gt; qwerty_desc  = "mnbvcxzlkjhgfdsapoiuytrewq",&lt;br /&gt; start   = badSequenceLength - 1,&lt;br /&gt; seq     = "_" + passwdString.slice(0, start),&lt;br /&gt; flg1=0;&lt;br /&gt; &lt;br /&gt; for (i = start; i &amp;lt; passwdString.length; i++) {&lt;br /&gt;  seq = seq.slice(1) + passwdString.charAt(i);&lt;br /&gt;  if (&lt;br /&gt;   lower_desc.indexOf(seq)   &amp;gt; -1 ||&lt;br /&gt;   upper_desc.indexOf(seq)   &amp;gt; -1 ||&lt;br /&gt;   numbers_desc.indexOf(seq) &amp;gt; -1 ||&lt;br /&gt;   (noQwertySequences &amp;&amp; qwerty_desc.indexOf(seq) &amp;gt; -1)&lt;br /&gt;  ) {&lt;br /&gt;   flg1++;&lt;br /&gt;   break;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;    &lt;br /&gt; if (flg1 &amp;gt; 0) {&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function isAlphabeticSequenceEvenChar (passwdString) {&lt;br /&gt;&lt;br /&gt; var i="0",&lt;br /&gt; evenChars="";&lt;br /&gt; &lt;br /&gt; //Even&lt;br /&gt; for(var i=0;i&amp;lt;passwdString.length;i+=2) { &lt;br /&gt;  evenChars += passwdString.charAt(i);&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; var lower_even   = "abcdefghijklmnopqrstuvwxyz",&lt;br /&gt; upper   = lower_even.toUpperCase(),&lt;br /&gt; numbers = "0123456789",&lt;br /&gt; badSequenceAltLength = 3,&lt;br /&gt; noQwertySequences = true,&lt;br /&gt; qwerty  = "qwertyuiopasdfghjklzxcvbnm",&lt;br /&gt; start   = badSequenceAltLength - 1,&lt;br /&gt; seq     = "_" + evenChars.slice(0, start),&lt;br /&gt; flg1=0;&lt;br /&gt;&lt;br /&gt; // enforce alphanumeric/qwerty sequence ban rules&lt;br /&gt; for (i = start; i &amp;lt; evenChars.length; i++) {&lt;br /&gt;  seq = seq.slice(1) + evenChars.charAt(i);&lt;br /&gt;  if (&lt;br /&gt;   lower_even.indexOf(seq)   &amp;gt; -1 ||&lt;br /&gt;   upper.indexOf(seq)   &amp;gt; -1 ||&lt;br /&gt;   numbers.indexOf(seq) &amp;gt; -1 ||&lt;br /&gt;   (noQwertySequences &amp;&amp; qwerty.indexOf(seq) &amp;gt; -1)&lt;br /&gt;  ) {&lt;br /&gt;   flg1++;&lt;br /&gt;   break;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; if (flg1 &amp;gt; 0) {&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; if (isAlphabeticSequenceRevChar(evenChars)) {&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; //Check for characters such as "bab4o1", "212epj"&lt;br /&gt; if (isAlphabeticSequenceRevCharDesc(evenChars)) {&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function isAlphabeticSequenceEvenCharDesc (passwdString) {&lt;br /&gt;&lt;br /&gt; var i="0",&lt;br /&gt; evenChars="";&lt;br /&gt; &lt;br /&gt; //Even&lt;br /&gt; for(var i=0;i&amp;lt;passwdString.length;i+=2) { &lt;br /&gt;  evenChars += passwdString.charAt(i);&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; var lower_even_desc   = "zyxwvutsrqponmlkjihgfedcba",&lt;br /&gt; upper_desc   = lower_even_desc.toUpperCase(),&lt;br /&gt; numbers_desc = "9876543210",&lt;br /&gt; badSequenceAltLength = 3,&lt;br /&gt; noQwertySequences = true,&lt;br /&gt; qwerty_desc  = "mnbvcxzlkjhgfdsapoiuytrewq",&lt;br /&gt; start   = badSequenceAltLength - 1,&lt;br /&gt; seq     = "_" + evenChars.slice(0, start),&lt;br /&gt; flg1=0;&lt;br /&gt;&lt;br /&gt; for (i = start; i &amp;lt; evenChars.length; i++) {&lt;br /&gt;  seq = seq.slice(1) + evenChars.charAt(i);&lt;br /&gt;  if (&lt;br /&gt;   lower_even_desc.indexOf(seq)   &amp;gt; -1 ||&lt;br /&gt;   upper_desc.indexOf(seq)   &amp;gt; -1 ||&lt;br /&gt;   numbers_desc.indexOf(seq) &amp;gt; -1 ||&lt;br /&gt;   (noQwertySequences &amp;&amp; qwerty_desc.indexOf(seq) &amp;gt; -1)&lt;br /&gt;  ) {&lt;br /&gt;   flg1++;&lt;br /&gt;   break;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; if (flg1 &amp;gt; 0) {&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; if (isAlphabeticSequenceRevChar(evenChars)) {&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; //Check for characters such as "bab4o1", "212epj"&lt;br /&gt; if (isAlphabeticSequenceRevCharDesc(evenChars)) {&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function isAlphabeticSequenceOddChar(passwdString) {&lt;br /&gt;&lt;br /&gt; var i="0",&lt;br /&gt; oddChars="";&lt;br /&gt; &lt;br /&gt; //Odd&lt;br /&gt; for(var i=1;i&amp;lt;passwdString.length;i+=2) { &lt;br /&gt;  oddChars += passwdString.charAt(i);&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; var lower_odd   = "abcdefghijklmnopqrstuvwxyz",&lt;br /&gt; upper   = lower_odd.toUpperCase(),&lt;br /&gt; numbers = "0123456789",&lt;br /&gt; badSequenceAltLength = 3,&lt;br /&gt; noQwertySequences = true,&lt;br /&gt; qwerty  = "qwertyuiopasdfghjklzxcvbnm",&lt;br /&gt; start   = badSequenceAltLength - 1,&lt;br /&gt; seq     = "_" + oddChars.slice(0, start),&lt;br /&gt; flg1=0;&lt;br /&gt;&lt;br /&gt; for (i = start; i &amp;lt; oddChars.length; i++) {&lt;br /&gt;  seq = seq.slice(1) + oddChars.charAt(i);&lt;br /&gt;  if (&lt;br /&gt;   lower_odd.indexOf(seq)   &amp;gt; -1 ||&lt;br /&gt;   upper.indexOf(seq)   &amp;gt; -1 ||&lt;br /&gt;   numbers.indexOf(seq) &amp;gt; -1 ||&lt;br /&gt;   (noQwertySequences &amp;&amp; qwerty.indexOf(seq) &amp;gt; -1)&lt;br /&gt;  ) {&lt;br /&gt;   flg1++;&lt;br /&gt;   break;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; if (flg1 &amp;gt; 0) {&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; if (isAlphabeticSequenceRevChar(oddChars)) {&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; //Check for characters such as "bab4o1", "212epj"&lt;br /&gt; if (isAlphabeticSequenceRevCharDesc(oddChars)) {&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function isAlphabeticSequenceOddCharDesc(passwdString) {&lt;br /&gt;&lt;br /&gt; var i="0",&lt;br /&gt; oddChars="";&lt;br /&gt; &lt;br /&gt; //Odd&lt;br /&gt; for(var i=1;i&amp;lt;passwdString.length;i+=2) { &lt;br /&gt;  oddChars += passwdString.charAt(i);&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; var lower_odd_desc   = "zyxwvutsrqponmlkjihgfedcba",&lt;br /&gt; upper_desc   = lower_odd_desc.toUpperCase(),&lt;br /&gt; numbers_desc = "9876543210",&lt;br /&gt; badSequenceAltLength = 3,&lt;br /&gt; noQwertySequences = true,&lt;br /&gt; qwerty_desc  = "mnbvcxzlkjhgfdsapoiuytrewq",&lt;br /&gt; start   = badSequenceAltLength - 1,&lt;br /&gt; seq     = "_" + oddChars.slice(0, start),&lt;br /&gt; flg1=0;&lt;br /&gt;&lt;br /&gt; for (i = start; i &amp;lt; oddChars.length; i++) {&lt;br /&gt;  seq = seq.slice(1) + oddChars.charAt(i);&lt;br /&gt;  if (&lt;br /&gt;   lower_odd_desc.indexOf(seq)   &amp;gt; -1 ||&lt;br /&gt;   upper_desc.indexOf(seq)   &amp;gt; -1 ||&lt;br /&gt;   numbers_desc.indexOf(seq) &amp;gt; -1 ||&lt;br /&gt;   (noQwertySequences &amp;&amp; qwerty_desc.indexOf(seq) &amp;gt; -1)&lt;br /&gt;  ) {&lt;br /&gt;   flg1++;&lt;br /&gt;   break;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; if (flg1 &amp;gt; 0) {&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; if (isAlphabeticSequenceRevChar(oddChars)) {&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; //Check for characters such as "bab4o1", "212epj"&lt;br /&gt; if (isAlphabeticSequenceRevCharDesc(oddChars)) {&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function isAlphabeticSequenceRevChar(passwdString) {&lt;br /&gt;&lt;br /&gt; var i="0",&lt;br /&gt; lower   = "abcdefghijklmnopqrstuvwxyz",&lt;br /&gt; upper   = lower.toUpperCase(),&lt;br /&gt; numbers = "0123456789",&lt;br /&gt; badSequenceRevLength = 2,&lt;br /&gt; start   = badSequenceRevLength - 1,&lt;br /&gt; seq     = "_" + passwdString.slice(0, start),&lt;br /&gt; flg1=0;&lt;br /&gt; &lt;br /&gt; for (i = start; i &amp;lt; passwdString.length; i++) {&lt;br /&gt;  &lt;br /&gt;  seq = seq.slice(1) + passwdString.charAt(i);&lt;br /&gt;  lower_seq = seq.toLowerCase();&lt;br /&gt;  upper_seq = seq.toUpperCase();&lt;br /&gt;  lower_passwdString = passwdString.toLowerCase();&lt;br /&gt;  upper_passwdString = passwdString.toUpperCase();&lt;br /&gt;  &lt;br /&gt;  if ( &lt;br /&gt;   (lower.indexOf(lower_seq)   &amp;gt; -1 &amp;&amp; (lower_passwdString.charAt(i+1)==lower_seq.substring(0,1)) ) ||&lt;br /&gt;   (upper.indexOf(upper_seq)   &amp;gt; -1  &amp;&amp; (upper_passwdString.charAt(i+1)==upper_seq.substring(0,1))) ||&lt;br /&gt;   (numbers.indexOf(seq) &amp;gt; -1 &amp;&amp; (upper_passwdString.charAt(i+1)==upper_seq.substring(0,1)) )&lt;br /&gt;  ) {   &lt;br /&gt;   flg1++;&lt;br /&gt;   break;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; if (flg1 &amp;gt; 0) {&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function isAlphabeticSequenceRevCharDesc(passwdString) {&lt;br /&gt;&lt;br /&gt; var i="0",&lt;br /&gt; lower_desc   = "zyxwvutsrqponmlkjihgfedcba",&lt;br /&gt; upper_desc   = lower_desc.toUpperCase(),&lt;br /&gt; numbers_desc = "9876543210",&lt;br /&gt; badSequenceRevLength = 2,&lt;br /&gt; start   = badSequenceRevLength - 1,&lt;br /&gt; seq     = "_" + passwdString.slice(0, start),&lt;br /&gt; flg1=0;&lt;br /&gt; &lt;br /&gt; for (i = start; i &amp;lt; passwdString.length; i++) {&lt;br /&gt;  &lt;br /&gt;  seq = seq.slice(1) + passwdString.charAt(i);&lt;br /&gt;  lower_seq = seq.toLowerCase();&lt;br /&gt;  upper_seq = seq.toUpperCase();&lt;br /&gt;  lower_passwdString = passwdString.toLowerCase();&lt;br /&gt;  upper_passwdString = passwdString.toUpperCase();&lt;br /&gt;  &lt;br /&gt;  if ( &lt;br /&gt;   (lower_desc.indexOf(lower_seq)   &amp;gt; -1 &amp;&amp; (lower_passwdString.charAt(i+1)==lower_seq.substring(0,1)) ) ||&lt;br /&gt;   (upper_desc.indexOf(upper_seq)   &amp;gt; -1  &amp;&amp; (upper_passwdString.charAt(i+1)==upper_seq.substring(0,1))) ||&lt;br /&gt;   (numbers_desc.indexOf(seq) &amp;gt; -1 &amp;&amp; (upper_passwdString.charAt(i+1)==upper_seq.substring(0,1)) )&lt;br /&gt;  ) {   &lt;br /&gt;   flg1++;&lt;br /&gt;   break;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; if (flg1 &amp;gt; 0) {&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function testPasswd(passwdString)&lt;br /&gt;{&lt;br /&gt;    var i="0";&lt;br /&gt;    var cch='0';&lt;br /&gt;    var nr=0;&lt;br /&gt; var noSequential = true;&lt;br /&gt; &lt;br /&gt; // enforce the no sequential, identical characters rule&lt;br /&gt; if (noSequential &amp;&amp; /([\S\s])\1/.test(passwdString)) {&lt;br /&gt;  document.getElementById("errorMessages").innerHTML = "Alphabetic/Numeric identical characters not allowed.";&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; // Check for normal sequence "abc", "123"&lt;br /&gt; if (isAlphabeticSequence(passwdString)) {&lt;br /&gt;  document.getElementById("errorMessages").innerHTML = "Alphabetic/Numeric sequence not allowed.";&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; // Check for normal sequence "cba", "321"&lt;br /&gt; if (isAlphabeticSequenceDesc(passwdString)) {&lt;br /&gt;  document.getElementById("errorMessages").innerHTML = "Alphabetic/Numeric sequence not allowed.";&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; /******** Check for alternate characters in a password string Starts here ********/&lt;br /&gt; //Check for alternate characters at Even positions (start position 0 [zero]) e.g. "a3bqc", "1j2d3k"&lt;br /&gt; if (isAlphabeticSequenceEvenChar(passwdString)) {&lt;br /&gt;  document.getElementById("errorMessages").innerHTML = "Alphabetic/Numeric sequence not allowed.";&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; //Check for alternate characters at Even positions in descending order (start position 0 [zero]) e.g. "cqb3a", "3k2d1j"&lt;br /&gt; if (isAlphabeticSequenceEvenCharDesc(passwdString)) {&lt;br /&gt;  document.getElementById("errorMessages").innerHTML = "Alphabetic/Numeric sequence not allowed.";&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; //Check for alternate characters at Odd positions (start position 0 [zero]) e.g. "3aqb6c", "j1d2k3"&lt;br /&gt; if (isAlphabeticSequenceOddChar(passwdString)) {&lt;br /&gt;  document.getElementById("errorMessages").innerHTML = "Alphabetic/Numeric sequence not allowed.";&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; //Check for alternate characters at Odd positions in descending order (start position 0 [zero]) e.g. "qc3bta", "k3d2j1"&lt;br /&gt; if (isAlphabeticSequenceOddCharDesc(passwdString)) {&lt;br /&gt;  document.getElementById("errorMessages").innerHTML = "Alphabetic/Numeric sequence not allowed.";&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; /******** Check for alternate characters in a password string Ends here ********/&lt;br /&gt; &lt;br /&gt; //Check for characters such as "aba4o1", "121epj"&lt;br /&gt; if (isAlphabeticSequenceRevChar(passwdString)) {&lt;br /&gt;  document.getElementById("errorMessages").innerHTML = "Alphabetic/Numeric sequence not allowed.";&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; //Check for characters such as "bab4o1", "212epj"&lt;br /&gt; if (isAlphabeticSequenceRevCharDesc(passwdString)) {&lt;br /&gt;  document.getElementById("errorMessages").innerHTML = "Alphabetic/Numeric sequence not allowed.";&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt;    if(passwdString.length &amp;lt; 8) {&lt;br /&gt;        document.getElementById("errorMessages").innerHTML = "A password should have at least 8 characters";&lt;br /&gt;        return true;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    if(passwdString.length &amp;gt; 12) {&lt;br /&gt;        document.getElementById("errorMessages").innerHTML = "A password should have no more than 12 characters";&lt;br /&gt;        return true;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    for(i=0;i&amp;lt;passwdString.length;i++) {&lt;br /&gt;        cch=passwdString.charAt(i);&lt;br /&gt;        if(cch &amp;gt;= 'a' &amp;&amp; cch &amp;lt;= 'z')&lt;br /&gt;            nr++;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    if(nr == passwdString.length) {&lt;br /&gt;        document.getElementById("errorMessages").innerHTML = "Password too simple. Please use a mix of upper and lower case letters and numerics.";&lt;br /&gt;        return true;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    //It must contain at least one number character&lt;br /&gt; if (!(passwdString.match(/\d/))) {&lt;br /&gt;      document.getElementById("errorMessages").innerHTML = "Password must include at least one number.";&lt;br /&gt;      return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; //It must start with at least one letter     &lt;br /&gt; if (!(passwdString.match(/^[a-zA-Z]+/))) {&lt;br /&gt;      document.getElementById("errorMessages").innerHTML = "Passwords must start with at least one letter.";&lt;br /&gt;      return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; //It must contain at least one upper case character     &lt;br /&gt; if (!(passwdString.match(/[A-Z]/))) {&lt;br /&gt;      //alert("Password must include at least one uppercase letter.");&lt;br /&gt;      document.getElementById("errorMessages").innerHTML = "Password must include at least one uppercase letter.";&lt;br /&gt;      return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; //It must contain at least one lower case character&lt;br /&gt; if (!(passwdString.match(/[a-z]/))) {&lt;br /&gt;      document.getElementById("errorMessages").innerHTML = "Password must include one or more lowercase letters.";&lt;br /&gt;      return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; //It must contain at least one special character&lt;br /&gt; if (!(passwdString.match(/\W+/))) {&lt;br /&gt;      //alert("Password must include at least one special character - #,@,%,!");&lt;br /&gt;      document.getElementById("errorMessages").innerHTML = "Password must include at least one special character - #,@,%,!";&lt;br /&gt;      return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; // Password should contain at least 4 different character "A1#dql"&lt;br /&gt; passwordString = passwdString.toUpperCase();&lt;br /&gt;&lt;br /&gt; var arr={}; &lt;br /&gt; var arrAlphabets = new Array();&lt;br /&gt; var temp=passwordString.split(""); &lt;br /&gt; for(key in temp) {&lt;br /&gt;     temp1=temp[key]; &lt;br /&gt;&lt;br /&gt;  arr[temp1] = arr[temp1]? arr[temp1] + 1 : 1;&lt;br /&gt; &lt;br /&gt;  if (!Search_Array(arrAlphabets, temp1)) {&lt;br /&gt;   arrAlphabets.push(temp1);&lt;br /&gt;  }&lt;br /&gt; } &lt;br /&gt;&lt;br /&gt; if (arrAlphabets.length &amp;lt; 4 ) {&lt;br /&gt;   document.getElementById("errorMessages").innerHTML = "Please enter at least 4 different alphabetical characters.";&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; if ( (passwdString.match(/\d/) &amp;&amp; passwdString.match(/\d/g).length &amp;gt;= 2) ){&lt;br /&gt;  return false;&lt;br /&gt; }&lt;br /&gt; else if ( (passwdString.match(/\W/) &amp;&amp; passwdString.match(/\W/g).length &amp;gt;= 2) ){&lt;br /&gt;  return false;&lt;br /&gt; }&lt;br /&gt; else if ( (passwdString.match(/\d/) &amp;&amp; passwdString.match(/\d/g).length == 1) &amp;&amp; (passwdString.match(/\W/) &amp;&amp; passwdString.match(/\W/g).length == 1) ){&lt;br /&gt;  return false;&lt;br /&gt; }&lt;br /&gt; else {&lt;br /&gt;  document.getElementById("errorMessages").innerHTML = "It must contain at least 2 non-alphabetic characters.";&lt;br /&gt;  return true;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt;    return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function testall()&lt;br /&gt;{&lt;br /&gt;    if(testPasswd(document.form1.txtpassword.value)) {&lt;br /&gt;       document.form1.txtpassword.focus(); &lt;br /&gt;       return false;&lt;br /&gt;    }&lt;br /&gt;    document.getElementById("errorMessages").innerHTML = "";&lt;br /&gt;    return true;&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;form name=form1&amp;gt;&lt;br /&gt;&amp;lt;span id="errorMessages"&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;&amp;lt;br&amp;gt;&lt;br /&gt;&amp;lt;b&amp;gt;Enter Password: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/b&amp;gt;&amp;lt;input type="text" name="txtpassword" onkeyup="return testall();"&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-7390560949567309650?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/7390560949567309650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=7390560949567309650' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/7390560949567309650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/7390560949567309650'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/04/how-to-implement-complex-password.html' title='How to implement Complex Password Validity Tester?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-7531980275162391496</id><published>2009-04-08T02:32:00.001-07:00</published><updated>2009-04-08T02:32:17.252-07:00</updated><title type='text'>How websites can detect which mobile phone is viewing the website?</title><content type='html'>There is a free PHP script available on the net that detects which phone is viewing the website.&lt;br /&gt;&lt;br /&gt;Reference URL: http://detectmobilebrowsers.mobi/&lt;br /&gt;&lt;br /&gt;- What are the Guidelines to create a website for mobile phone?&lt;br /&gt;&lt;br /&gt;A very good article is available on the net. Please check the below URL for details.&lt;br /&gt;&lt;br /&gt;Reference URL: http://www.webcredible.co.uk/user-friendly-resources/web-usability/mobile-guidelines.shtml&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-7531980275162391496?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/7531980275162391496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=7531980275162391496' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/7531980275162391496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/7531980275162391496'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/04/how-websites-can-detect-which-mobile.html' title='How websites can detect which mobile phone is viewing the website?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-1927347593632417603</id><published>2009-04-08T02:31:00.005-07:00</published><updated>2009-04-08T02:31:57.101-07:00</updated><title type='text'>Session ID not getting propogated in the URL properly?</title><content type='html'>When you generate URLs yourself using the SID variable, it must come first in the URL parameter list.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;If SID expands to "some_session=123" then this does NOT work:&lt;br /&gt;&lt;br /&gt;  somefile.php?var1=value&amp;some_session=123&lt;br /&gt;&lt;br /&gt;The SID must come first in the query string:&lt;br /&gt;&lt;br /&gt;  somefile.php?some_session=123&amp;var1=value&lt;br /&gt;&lt;br /&gt;If the SID does not come first in the query string then session_start() does not recognise the session variable in the URL and creates a NEW session instead of loading the old one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-1927347593632417603?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/1927347593632417603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=1927347593632417603' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/1927347593632417603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/1927347593632417603'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/04/session-id-not-getting-propogated-in.html' title='Session ID not getting propogated in the URL properly?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-8543822244447682571</id><published>2009-04-08T02:31:00.003-07:00</published><updated>2009-04-08T02:31:35.104-07:00</updated><title type='text'>How to change the values in the php.ini file dynamically?</title><content type='html'>Have a look at http://de.php. net/manual/ en/ini.php# ini.list&lt;br /&gt;You will see, that upload_max_filesize and post_max_size are settable by PHP_INI_PERDIR, what means that "Entry can be set in php.ini, .htaccess or httpd.conf"&lt;br /&gt;&lt;br /&gt;Steps:&lt;br /&gt;create .htaccess file and type the below code in this file&lt;br /&gt;&lt;br /&gt;php_value upload_max_filesize 100M&lt;br /&gt;&lt;br /&gt;and upload the file on that directory where u need it&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-8543822244447682571?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/8543822244447682571/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=8543822244447682571' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/8543822244447682571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/8543822244447682571'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/04/how-to-change-values-in-phpini-file.html' title='How to change the values in the php.ini file dynamically?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-8670050840040598509</id><published>2009-04-08T02:31:00.001-07:00</published><updated>2009-04-08T02:31:15.189-07:00</updated><title type='text'>How to capture video thumbnail with php scripting?</title><content type='html'>The tool is called imagemagick.&lt;br /&gt;&lt;br /&gt;You have to use both ffmpeg and imagemagick as well. First get the frames from the video file using ffmpeg and then use the imagemagic command to create the thumbnails.&lt;br /&gt;&lt;br /&gt;Refer the following sites for further details.&lt;br /&gt;&lt;br /&gt;www. &lt;http://www.imagemag ick.org/&gt; imagemagick. org/&lt;br /&gt;http://ffmpeg. mplayerhq. hu/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-8670050840040598509?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/8670050840040598509/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=8670050840040598509' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/8670050840040598509'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/8670050840040598509'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/04/how-to-capture-video-thumbnail-with-php.html' title='How to capture video thumbnail with php scripting?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-5617044676055698104</id><published>2009-04-08T02:30:00.005-07:00</published><updated>2009-04-08T02:30:58.675-07:00</updated><title type='text'>How to resize an image to fit in the opened window?</title><content type='html'>You can use the JavaScript 'availheight' and 'height' properties (http://msdn. microsoft. com/workshop/ author/dhtml/ reference/ objects/obj_ screen.asp) to work out the size of the screen, and then use 'window.open' to open a window of that size.&lt;br /&gt;&lt;br /&gt;Beware, not all browsers support these properties - some have there own versions, so you may need to code accordingly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-5617044676055698104?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/5617044676055698104/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=5617044676055698104' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/5617044676055698104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/5617044676055698104'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/04/how-to-resize-image-to-fit-in-opened.html' title='How to resize an image to fit in the opened window?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-5811215803683304925</id><published>2009-04-08T02:30:00.003-07:00</published><updated>2009-04-08T02:30:38.910-07:00</updated><title type='text'>What is PHP FrameWork? And which one is good?</title><content type='html'>Frameweork is something which helps you do not reinvent the wheel again. For example, think of a authentication system. Obviously it would be having users table in database and needs the CRUD operations. How it would be if by configuration , a system gives you nearly all the functions to manipulate the user table. Or think a self build caching system, or session handling system up in just a few config settings.&lt;br /&gt;&lt;br /&gt;Simphony is something matching ruby on rails framework and is very good. But if you do not intend to build high end applications or is light weight application your aim go for CodeIgnitor.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-5811215803683304925?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/5811215803683304925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=5811215803683304925' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/5811215803683304925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/5811215803683304925'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/04/what-is-php-framework-and-which-one-is.html' title='What is PHP FrameWork? And which one is good?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-4533988300370479980</id><published>2009-04-08T02:30:00.001-07:00</published><updated>2009-04-08T02:30:19.453-07:00</updated><title type='text'>How can I work with XML in PHP ? What´s the best way ?</title><content type='html'>You can do it using two ways: &lt;br /&gt;1. xml parser functions &lt;br /&gt;2. xml dom functions &lt;br /&gt;&lt;br /&gt;DOM functions are more complex &amp; object oriented but handy. While parsing functions are simple to understand. Choice is yours.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-4533988300370479980?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/4533988300370479980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=4533988300370479980' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/4533988300370479980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/4533988300370479980'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/04/how-can-i-work-with-xml-in-php-whats.html' title='How can I work with XML in PHP ? What´s the best way ?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-1320741936691257809</id><published>2009-04-08T02:29:00.003-07:00</published><updated>2009-04-08T02:29:56.859-07:00</updated><title type='text'>How to call MySQL stored procedure in PHP with output parameter?</title><content type='html'>Check the below example.&lt;br /&gt;&lt;br /&gt;//Say following is the store procedure you have&lt;br /&gt;&lt;br /&gt;DELIMITER //&lt;br /&gt;DROP PROCEDURE IF EXISTS yourdbname.gsp_GetCountryList //&lt;br /&gt;CREATE PROCEDURE yourdbname.gsp_GetCountryList()&lt;br /&gt;BEGIN&lt;br /&gt;SELECT Id,strCountryName from youtable;&lt;br /&gt;END//&lt;br /&gt;&lt;br /&gt;//the above has to be run on mysql prompt&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//change the php variables according to your setting&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function iconnect()&lt;br /&gt;{&lt;br /&gt; $mysqli = new mysqli($YOURHOST, $YOURUSERNAME, $YOURPASSWORD, $YOURDATABASE);&lt;br /&gt;&lt;br /&gt; /* check connection */&lt;br /&gt; if (mysqli_connect_errno()) {&lt;br /&gt;  printf("Connect failed: %s\n", mysqli_connect_error());&lt;br /&gt;  exit();&lt;br /&gt; }&lt;br /&gt; return $mysqli;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$retval=iconnect();&lt;br /&gt;&lt;br /&gt;$sql1 = "call sp1()";&lt;br /&gt;$query1 = $retval-&gt;query($sql1);&lt;br /&gt;while ($data1 = $query1-&gt;fetch_row()) {&lt;br /&gt; echo "&lt;br /&gt;\n".$data1[0].":".$data1[1];&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-1320741936691257809?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/1320741936691257809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=1320741936691257809' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/1320741936691257809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/1320741936691257809'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/04/how-to-call-mysql-stored-procedure-in.html' title='How to call MySQL stored procedure in PHP with output parameter?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-4581317728744246929</id><published>2009-04-08T02:29:00.001-07:00</published><updated>2009-04-08T02:29:21.087-07:00</updated><title type='text'>How to access a file on a remote server?</title><content type='html'>There are 2 simple way to do that. First, using fopen(), second, cURL functions.&lt;br /&gt;&lt;br /&gt;Below is a the sample code for servers that support cURL:&lt;br /&gt;------------ --------- --------- --------- --------- -----&lt;br /&gt;//////////// ///////// ///////// ///////// ////////&lt;br /&gt;function url_exists($ strURL) {&lt;br /&gt;$resURL = curl_init();&lt;br /&gt;curl_setopt( $resURL, CURLOPT_URL, $strURL);&lt;br /&gt;// return the result instead of echoing it&lt;br /&gt;curl_setopt( $resURL, CURLOPT_RETURNTRANS FER, 1);&lt;br /&gt;// time out after 5 seconds of no response&lt;br /&gt;curl_setopt( $resURL, CURLOPT_TIMEOUT, 5);&lt;br /&gt;&lt;br /&gt;$result = curl_exec ($resURL);&lt;br /&gt;if ($result === false) {&lt;br /&gt;curl_close($ resURL);&lt;br /&gt;return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$intReturnCode = curl_getinfo( $resURL, CURLINFO_HTTP_ CODE);&lt;br /&gt;curl_close ($resURL);&lt;br /&gt;&lt;br /&gt;if ($intReturnCode != 200 &amp;&amp; $intReturnCode != 302 &amp;&amp; $intReturnCode !=&lt;br /&gt;304) {&lt;br /&gt;return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;return true;&lt;br /&gt;}&lt;br /&gt;//////////// ///////// ///////// ///////// ////////&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-4581317728744246929?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/4581317728744246929/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=4581317728744246929' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/4581317728744246929'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/4581317728744246929'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/04/how-to-access-file-on-remote-server.html' title='How to access a file on a remote server?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-1790125615023893718</id><published>2009-04-08T02:28:00.005-07:00</published><updated>2009-04-08T02:28:57.634-07:00</updated><title type='text'>How to generate a document using php?</title><content type='html'>There are the following 2 ways to achieve this:&lt;br /&gt;&lt;br /&gt;1. MS Office documents can be created on Windows platforms using COM called from PHP :-&lt;br /&gt;&lt;br /&gt;http://web.informba nk.com/articles/ technology/ php-office- documents. htm&lt;br /&gt;&lt;br /&gt;2. There's a class at http://www.phpclass es.org/browse/ package/2631. html for Word documents that doesn't require COM, but this just uses the XHTML&lt;br /&gt;alternative method.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-1790125615023893718?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/1790125615023893718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=1790125615023893718' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/1790125615023893718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/1790125615023893718'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/04/how-to-generate-document-using-php.html' title='How to generate a document using php?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-7687914305010476353</id><published>2009-04-08T02:28:00.003-07:00</published><updated>2009-04-08T02:28:37.410-07:00</updated><title type='text'>How to find GMT time for partcular locations (country) using dynamically using php script?</title><content type='html'>Using Php Script:&lt;br /&gt;&lt;br /&gt;function zonedate($layout, $countryzone, $daylightsaving) {&lt;br /&gt;&lt;br /&gt; if ($daylightsaving) {&lt;br /&gt;&lt;br /&gt;  $daylight_saving = date('I');&lt;br /&gt;  if ($daylight_saving) {&lt;br /&gt;   $zone=3600* ($countryzone+ 1);&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; else {&lt;br /&gt;  if ($countryzone&gt; &gt;0){$zone= 3600*$countryzon e;}&lt;br /&gt;  else {$zone=0;}&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; $date=gmdate( $layout, time() + $zone);&lt;br /&gt; return $date;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//I'm from north of spanish state, my GMT zone is -1, put yours and you will have the time,&lt;br /&gt;&lt;br /&gt;$zonealDate = zonedate('d- m-y H:i a ',-1,true);&lt;br /&gt;&lt;br /&gt;echo $zonealDate;&lt;br /&gt;&lt;br /&gt;Using Javascript:&lt;br /&gt;&lt;br /&gt;new date();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-7687914305010476353?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/7687914305010476353/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=7687914305010476353' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/7687914305010476353'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/7687914305010476353'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/04/how-to-find-gmt-time-for-partcular.html' title='How to find GMT time for partcular locations (country) using dynamically using php script?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-1409311785560062892</id><published>2009-04-08T02:28:00.001-07:00</published><updated>2009-04-08T02:28:16.874-07:00</updated><title type='text'>How to download fonts dynamically, when the user is viewing the site?</title><content type='html'>Well there is a technique of uploading the font archive that you want to use to the server and use it with php and it renders it into an image the text that you use with that font. &lt;br /&gt;&lt;br /&gt;Below is the link to check the site&lt;br /&gt;http://www.alistapart.com/articles/dynatext&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-1409311785560062892?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/1409311785560062892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=1409311785560062892' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/1409311785560062892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/1409311785560062892'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/04/how-to-download-fonts-dynamically-when.html' title='How to download fonts dynamically, when the user is viewing the site?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-6057798107957329310</id><published>2009-04-08T02:25:00.000-07:00</published><updated>2009-04-08T02:27:33.135-07:00</updated><title type='text'>Warning: Unknown: Node no longer exists in Unknown on line 0 solution</title><content type='html'>I got the following error on my php pages using SimpleXMLElement and $_SESSION function.&lt;br /&gt;&lt;br /&gt;The solution is to add a session_destroy() function at the end of any file which contains session_start() and it should work!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-6057798107957329310?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/6057798107957329310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=6057798107957329310' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/6057798107957329310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/6057798107957329310'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/04/warning-unknown-node-no-longer-exists.html' title='Warning: Unknown: Node no longer exists in Unknown on line 0 solution'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34762507.post-5702319705207926150</id><published>2009-04-08T02:20:00.000-07:00</published><updated>2009-04-09T08:40:52.183-07:00</updated><title type='text'>SEO and Dynamic Site in PHP?</title><content type='html'>If your web site is designed using PHP that displays a static/same page title from an include file for all the pages of the site, it looks like a good idea, but in a longer run you may loose on SEO ratings since all your pages would have the same page title. &lt;br /&gt;&lt;br /&gt;Here is a better and easy way of using a single "include" file for the header while still creating unique page titles for every page. This also works for meta tags. Please check the example below.&lt;br /&gt;&lt;br /&gt;Here you would need a header file say "header.php" that would be included at the top of every page on your site - this generates the info contained in &amp;lt;head&amp;gt;. &lt;br /&gt;The page we want to create a unique title tag for will be called "product.php":&lt;br /&gt;&lt;br /&gt;Add the below code to "header.php". An "else" statement would display a default Meta tags if you have not specified the values/variable on the website pages:&lt;br /&gt;&lt;br /&gt;&amp;lt;title&amp;gt;&amp;lt;?php if(isset($title)) { print $title; } else { print "Default title comes here"; } ?&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;meta name="keywords" content="&amp;lt;?php if(isset($keywords)) { print $keywords; } else { print "keyword1,keyword2,keyword3,etc"; } ?&amp;gt;" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;meta name="description" content="&amp;lt;?php if(isset($description)) { print $description; } else { print "Default description tag goes here."; } ?&amp;gt;" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Add this code to product.php to specify the info you want used in the tags:&lt;br /&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;$title = "Add title to product.php here";&lt;br /&gt;&lt;br /&gt;$keywords = "keyword1, keyword2, keyword3, etc";&lt;br /&gt;&lt;br /&gt;$description = "Specify description of product.php here.";&lt;br /&gt;&lt;br /&gt;require_once("header.php");&lt;br /&gt;&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;Thats it! and you are good to go! :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-5702319705207926150?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/5702319705207926150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=5702319705207926150' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/5702319705207926150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/5702319705207926150'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/04/seo-and-dynamic-site-in-php.html' title='SEO and Dynamic Site in PHP?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-6097267408037025874</id><published>2009-04-08T02:19:00.000-07:00</published><updated>2009-04-08T02:20:14.348-07:00</updated><title type='text'>How to upload same file to 2 different Servers.</title><content type='html'>This could be done in 2 simple Steps:&lt;br /&gt;&lt;br /&gt;1. First upload to the main server or the one where the php scripts are hosted.&lt;br /&gt;&lt;br /&gt;2. Second, either via a cron job running after a specific time or in the upload script itself copy the files to the other server.&lt;br /&gt;&lt;br /&gt;The below sample code is to copy the file to second server using FTP functions.&lt;br /&gt;&lt;br /&gt;// Details of the second server.&lt;br /&gt;$host = 'host';&lt;br /&gt;$user = 'username';&lt;br /&gt;$pass = 'password';&lt;br /&gt;&lt;br /&gt;//Path of the uploaded file i.e. on first server.&lt;br /&gt;$local_file = 'path of file/file.txt' ;&lt;br /&gt;&lt;br /&gt;//Path of the second file.&lt;br /&gt;$remote_file = 'path of file/file.txt' ;&lt;br /&gt;&lt;br /&gt;// set up basic connection&lt;br /&gt;$conn_id = ftp_connect($host); &lt;br /&gt;&lt;br /&gt;// login with username and password&lt;br /&gt;$login_result = ftp_login($conn_id, $user, $pass); &lt;br /&gt;&lt;br /&gt;// check connection&lt;br /&gt;if ((!$conn_id) || (!$login_result)) { &lt;br /&gt;    &lt;br /&gt;   echo "Cannot initiate connection to host";&lt;br /&gt;   exit;&lt;br /&gt;} &lt;br /&gt;else {&lt;br /&gt;&lt;br /&gt;    // upload the file&lt;br /&gt;    $upload = ftp_put($conn_id, $remote_file, $local_file, FTP_BINARY); &lt;br /&gt;    &lt;br /&gt;    //Close FTP connection&lt;br /&gt;    ftp_close($conn_id); &lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-6097267408037025874?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/6097267408037025874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=6097267408037025874' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/6097267408037025874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/6097267408037025874'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2009/04/how-to-upload-same-file-to-2-different.html' title='How to upload same file to 2 different Servers.'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-8838262752596149697</id><published>2008-08-25T03:40:00.000-07:00</published><updated>2011-02-10T23:38:48.967-08:00</updated><title type='text'>How to make javascript sub menus appear above flash objects?</title><content type='html'>Flash objects are considered to be "windows" on top of the browser and this is why they cover the submenus by default. &lt;br /&gt;This can be easily changed by making the chnages to the HTML code. &lt;br /&gt;The solution is to add a "opaque" attribute to the "&amp;lt;param&amp;gt;" parameter and "transparent" parameter inside your Flash object definition, as shown on the example below:&lt;br /&gt;&lt;br /&gt;&amp;lt;object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=10,1,1,0" width="806" height="200"&amp;gt;&lt;br /&gt; &amp;lt;param name="WMode" value="opaque"&amp;gt;&lt;br /&gt; &amp;lt;param name="movie" value="/images/header/test.swf"&amp;gt;&lt;br /&gt; &amp;lt;param name="quality" value="high"&amp;gt;&lt;br /&gt; &amp;lt;embed src="/images/header/test.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="806" height="200" wmode="transparent"&amp;gt;&amp;lt;/embed&amp;gt; &lt;br /&gt;&amp;lt;/object&amp;gt;&lt;br /&gt;&lt;br /&gt;By adding the "Opaque" &amp; "Transparent" parameter on both locations the submenus will always appear above Flash objects on all browsers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-8838262752596149697?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/8838262752596149697/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=8838262752596149697' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/8838262752596149697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/8838262752596149697'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2008/08/how-to-make-javascript-sub-menus-appear_25.html' title='How to make javascript sub menus appear above flash objects?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-8533111258192539185</id><published>2008-08-25T03:26:00.000-07:00</published><updated>2011-02-10T23:37:28.087-08:00</updated><title type='text'>How to change the font attributes dynamically using Javascript?</title><content type='html'>HTML code example:&lt;br /&gt;&lt;br /&gt;&amp;lt;div align="center"&amp;gt;&lt;br /&gt; &amp;lt;font size="2" face="Times New Roman" color="#000000" id="field1"&amp;gt; Field Lable &amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;In the input box, you could call the function ChangeFont(size)&lt;br /&gt;&lt;br /&gt;&amp;lt;SCRIPT LANGUAGE="JavaScript"&amp;gt;&lt;br /&gt;&amp;lt;!-- Heres the code to change the font&lt;br /&gt;function ChangeFont(size)&lt;br /&gt;{&lt;br /&gt;    text2.style.fontFamily="Arial";&lt;br /&gt;    text2.style.fontSize=size;&lt;br /&gt;}--&amp;gt;&lt;br /&gt;&amp;lt;/SCRIPT&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-8533111258192539185?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/8533111258192539185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=8533111258192539185' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/8533111258192539185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/8533111258192539185'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2008/08/how-to-change-font-attributes.html' title='How to change the font attributes dynamically using Javascript?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-6885187635696414158</id><published>2008-06-05T02:25:00.000-07:00</published><updated>2008-06-05T02:26:18.126-07:00</updated><title type='text'>How to output a number with leading zero's?</title><content type='html'>Simple:&lt;br /&gt;&lt;br /&gt;$number = 15;&lt;br /&gt;printf("%05d", $number);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-6885187635696414158?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/6885187635696414158/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=6885187635696414158' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/6885187635696414158'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/6885187635696414158'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2008/06/how-to-output-number-with-leading-zeros.html' title='How to output a number with leading zero&apos;s?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-1093388419202101418</id><published>2008-06-05T02:24:00.000-07:00</published><updated>2008-06-05T02:25:30.434-07:00</updated><title type='text'>How do I set the browser timeout?</title><content type='html'>If your script is too complex to finish within the standard 30 seconds you can set a new value with the function:&lt;br /&gt;&lt;br /&gt;set_time_limit(900);&lt;br /&gt;&lt;br /&gt;this sets the timeout too 900 seconds / 15 minutes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-1093388419202101418?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/1093388419202101418/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=1093388419202101418' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/1093388419202101418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/1093388419202101418'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2008/06/how-do-i-set-browser-timeout.html' title='How do I set the browser timeout?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-7314797968522497041</id><published>2008-06-05T02:23:00.002-07:00</published><updated>2008-06-05T02:24:48.203-07:00</updated><title type='text'>How do I format a number in a corect way?</title><content type='html'>You can use the number_format() function, you can find more information about the function in the PHP manual.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-7314797968522497041?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/7314797968522497041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=7314797968522497041' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/7314797968522497041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/7314797968522497041'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2008/06/how-do-i-format-number-in-corect-way.html' title='How do I format a number in a corect way?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-3403899275184863918</id><published>2008-06-05T02:23:00.001-07:00</published><updated>2008-06-05T02:23:44.983-07:00</updated><title type='text'>How to send HTML mail with php?</title><content type='html'>You would need to add a HTML content type to your mail header, as shown below:&lt;br /&gt;&lt;br /&gt;mail($recipient, $subject, $message, From: $sender\nContent-Type: text/html;);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-3403899275184863918?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/3403899275184863918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=3403899275184863918' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/3403899275184863918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/3403899275184863918'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2008/06/how-to-send-html-mail-with-php.html' title='How to send HTML mail with php?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-1607548869851586333</id><published>2008-06-05T02:22:00.001-07:00</published><updated>2008-06-05T02:22:57.408-07:00</updated><title type='text'>When I try to connect to mysql from php I get this error: "Call to unsupported or undefined function mysql_connect();"</title><content type='html'>Either you are missing mysql support in the php module or you need to load mysql dynamicly in your scripts by inserting:&lt;br /&gt;&lt;br /&gt;dl("mysql.so"); (on unix)&lt;br /&gt;dl("mysql.dll"); (on windows);&lt;br /&gt;&lt;br /&gt;in the top of all the scripts that use mysql.&lt;br /&gt;&lt;br /&gt;But it is recommended to compile php with mysql.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-1607548869851586333?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/1607548869851586333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=1607548869851586333' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/1607548869851586333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/1607548869851586333'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2008/06/when-i-try-to-connect-to-mysql-from-php.html' title='When I try to connect to mysql from php I get this error: &quot;Call to unsupported or undefined function mysql_connect();&quot;'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-115961545494439498</id><published>2006-09-30T04:21:00.000-07:00</published><updated>2006-09-30T04:27:38.696-07:00</updated><title type='text'>I get an "Warning: Unknown:" error message at the bottom of the page</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Question:&lt;/span&gt;&lt;br /&gt;I get an "Warning: Unknown:" error message at the bottom of the page &lt;br /&gt;when I log in to the page.&lt;br /&gt;&lt;br /&gt;"&lt;span style="font-weight:bold;"&gt;Warning: Unknown:&lt;/span&gt; Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless &lt;br /&gt;register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0"&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Below is the solution to this problem&lt;/span&gt;:&lt;br /&gt; &lt;br /&gt;The session_register() function references global variables itself. &lt;br /&gt;Instead set the session variable directly to use the SUPER GLOBAL &lt;br /&gt;"$_SESSION" variable. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Example&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;        session_register('loginName');&lt;br /&gt;        &lt;br /&gt;        should be re written as:&lt;br /&gt;        &lt;br /&gt;        $_SESSION['loginName'] = $loginName;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Note&lt;/span&gt;: You can still use the session_is_registered() and &lt;br /&gt;session_unregister() functions when you set the variable directly in the $_SESSION &lt;br /&gt;super global.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-115961545494439498?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/115961545494439498/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=115961545494439498' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/115961545494439498'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/115961545494439498'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2006/09/i-get-warning-unknown-error-message-at.html' title='I get an &quot;Warning: Unknown:&quot; error message at the bottom of the page'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-115961419339844132</id><published>2006-09-30T04:00:00.000-07:00</published><updated>2006-09-30T04:20:53.343-07:00</updated><title type='text'>Problem executing PHP code.</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Question:&lt;/span&gt; i have a problem in PHP executing the following code:&lt;br /&gt;&lt;br /&gt;when i make a small program lets say, test.html having the below code:&lt;br /&gt;&lt;br /&gt;[Remember to start &amp; end the HTML tags at the position marked as "#" ]&lt;br /&gt;&lt;br /&gt;#form method="post" action="test1.php"#&lt;br /&gt;&lt;br /&gt;insert any text : #input type=text name="text1"#&lt;br /&gt;#form#&lt;br /&gt;&lt;br /&gt;Now, create a simple php page "test1.php" having the below code:&lt;br /&gt;&lt;br /&gt;echo "$text1";&lt;br /&gt;&lt;br /&gt;when u run it the text that u entered in TEXT box appear in the &lt;br /&gt;test1.php.&lt;br /&gt;in my case it's dosn't work ... i don't know what's wrong ... &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There are 2 solutions to the problem:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;First Approach:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Please check your php.ini config file for the "register_globals" &lt;br /&gt;configuration set to On, if its "Off" try to Set it "On" then&lt;br /&gt;restart your web server, then try running your script.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;span style="font-style:italic;"&gt;Note:&lt;/span&gt;&lt;/span&gt; Setting "register_globals" to "On" is a potential security issue.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Second Approach:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In your test1.php file write the code:&lt;br /&gt;&lt;br /&gt;echo $_POST['text1' ]; &lt;br /&gt;&lt;br /&gt;and it sould work fine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-115961419339844132?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/115961419339844132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=115961419339844132' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/115961419339844132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/115961419339844132'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2006/09/problem-executing-php-code.html' title='Problem executing PHP code.'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-115886628545677990</id><published>2006-09-21T12:18:00.000-07:00</published><updated>2006-09-21T12:18:05.460-07:00</updated><title type='text'>How can I send variables from a PHP script to another URL using POST method without using forms and hidden variables?</title><content type='html'>&lt;b&gt;Question :&lt;/b&gt;&lt;br /&gt;How can I send variables from a PHP script to another URL using POST method without using forms and hidden variables?&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Answer :&lt;/b&gt;&lt;br /&gt;You can do this by opening an HTTP socket connection and send HTTP POST commands.&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;?&lt;br /&gt;// Generate a request header&lt;br /&gt;$RequestHeader =&lt;br /&gt;"POST $URI HTTP/1.1\n".&lt;br /&gt;"Host: $Host\n".&lt;br /&gt;"Content-Type: application/x-www-form-urlencoded\n".&lt;br /&gt;"Content-Length: $ContentLength\n\n".&lt;br /&gt;"$RequestBody\n";&lt;br /&gt;&lt;br /&gt;// Open the connection to the host&lt;br /&gt;$socket = fsockopen($Host, 80, &amp;$errno, &amp;$errstr);&lt;br /&gt;if (!$socket)&lt;br /&gt;&lt;br /&gt;$Result["errno"] = $errno;&lt;br /&gt;$Result["errstr"] = $errstr;&lt;br /&gt;return $Result;&lt;br /&gt;}&lt;br /&gt;$idx = 0;&lt;br /&gt;fputs($socket, $RequestHeader);&lt;br /&gt;while (!feof($socket))&lt;br /&gt;&lt;br /&gt;$Result[$idx++] = fgets($socket, 128);&lt;br /&gt;}&lt;br /&gt;//-------------------------------------------&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Or you can use the php cURL functions. this is mostly used for sending the Credit Card details over the secure channel.&lt;br /&gt;&lt;br /&gt;&lt;?&lt;br /&gt;$URL="www.testsite.com/test.php";&lt;br /&gt;$ch = curl_init();   &lt;br /&gt;curl_setopt($ch, CURLOPT_URL,"https://$URL"); &lt;br /&gt;curl_setopt($ch, CURLOPT_POST, 1);&lt;br /&gt;curl_setopt($ch, CURLOPT_POSTFIELDS, "Data1=blah&amp;Data2=blah");curl_exec ($ch);    &lt;br /&gt;curl_close ($ch);&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;This will have an effect of posting your data to the $URL site, without any header hacking.&lt;br /&gt;&lt;br /&gt;To use cURL you need to recompile PHP with cURL support.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-115886628545677990?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/115886628545677990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=115886628545677990' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/115886628545677990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/115886628545677990'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2006/09/how-can-i-send-variables-from-php.html' title='How can I send variables from a PHP script to another URL using POST method without using forms and hidden variables?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-115886540670993365</id><published>2006-09-21T12:03:00.000-07:00</published><updated>2006-09-21T12:03:26.710-07:00</updated><title type='text'>How do I check whether a string contains HTML tags?</title><content type='html'>&lt;b&gt;Question :&lt;/b&gt;&lt;br /&gt;How do I check whether a string contains HTML tags?&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Answer :&lt;/b&gt;&lt;br /&gt;There are two ways you can do it, one is using a regular expression and the other is comparing strings.&lt;br /&gt;&lt;br /&gt;First the regular expression approach:&lt;br /&gt;&lt;br /&gt;if (preg_match("/([\&lt;])([^\&gt;]{1,})*([\&gt;])/i", $string)) {&lt;br /&gt;    echo "string contains html";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Second a comparing string approach:&lt;br /&gt;&lt;br /&gt;if(strlen($string) != strlen(strip_tags($string)){&lt;br /&gt;  echo "string contains HTML";&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-115886540670993365?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/115886540670993365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=115886540670993365' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/115886540670993365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/115886540670993365'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2006/09/how-do-i-check-whether-string-contains.html' title='How do I check whether a string contains HTML tags?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34762507.post-115886526857231710</id><published>2006-09-21T12:01:00.000-07:00</published><updated>2006-09-21T12:01:08.573-07:00</updated><title type='text'>How do I set the browsers timeout?</title><content type='html'>&lt;b&gt;Question :&lt;/b&gt;&lt;br /&gt;How do I set the browsers timeout?&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution :&lt;/b&gt;&lt;br /&gt;If your script is too complex to finish within the standard 30 seconds time limit you can set a new value using the function:&lt;br /&gt;&lt;br /&gt;set_time_limit(600);&lt;br /&gt;&lt;br /&gt;this sets the timeout too 600 seconds / 10 minutes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-115886526857231710?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/115886526857231710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=115886526857231710' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/115886526857231710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/115886526857231710'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2006/09/how-do-i-set-browsers-timeout.html' title='How do I set the browsers timeout?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-115886512377616112</id><published>2006-09-21T11:58:00.000-07:00</published><updated>2006-09-21T11:58:43.776-07:00</updated><title type='text'>How to display a number with leading zero's?</title><content type='html'>&lt;b&gt;Question :&lt;/b&gt;&lt;br /&gt;How to display a number with leading zero's?&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Answer :&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;$number = 15;&lt;br /&gt;printf("%05d", $number);&lt;br /&gt;?&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-115886512377616112?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/115886512377616112/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=115886512377616112' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/115886512377616112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/115886512377616112'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2006/09/how-to-display-number-with-leading.html' title='How to display a number with leading zero&apos;s?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-115886506348112906</id><published>2006-09-21T11:57:00.000-07:00</published><updated>2006-09-21T11:57:43.483-07:00</updated><title type='text'>How do I generate a random number using php script?</title><content type='html'>&lt;b&gt;Question :&lt;/b&gt;&lt;br /&gt;How do I generate a random number using php script?&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Answer :&lt;/b&gt;&lt;br /&gt;To generate a random number say, between 0 and 100 use the following code:&lt;br /&gt;&lt;br /&gt;&lt;?php &lt;br /&gt;srand((double)microtime()*1000000); &lt;br /&gt;echo rand(0,100);&lt;br /&gt;?&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-115886506348112906?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/115886506348112906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=115886506348112906' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/115886506348112906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/115886506348112906'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2006/09/how-do-i-generate-random-number-using.html' title='How do I generate a random number using php script?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-115886501383843131</id><published>2006-09-21T11:56:00.000-07:00</published><updated>2006-09-21T11:56:53.843-07:00</updated><title type='text'>How do I get a users IP address?</title><content type='html'>&lt;b&gt;Question :&lt;/b&gt;&lt;br /&gt;How do I get a users IP address?&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Answer :&lt;/b&gt;&lt;br /&gt;The users ip address is stored in the environment variable $REMOTE_ADDR, if you want to resolve the domain name for that ip use:&lt;br /&gt;&lt;br /&gt;&lt;? $domain = GetHostByName($REMOTE_ADDR); ?&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-115886501383843131?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/115886501383843131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=115886501383843131' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/115886501383843131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/115886501383843131'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2006/09/how-do-i-get-users-ip-address.html' title='How do I get a users IP address?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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-34762507.post-115878688960380468</id><published>2006-09-20T14:09:00.000-07:00</published><updated>2006-09-20T14:14:49.626-07:00</updated><title type='text'>What are the differences between Get and post methods in form submitting?</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: verdana;"&gt;The HTML specifications technically defines the difference between "GET" and "POST" methods, so that former means that form data is to be encoded (by a browser) into a URL while the latter means that the form data is to appear within a message body. The specifications also give the usage recommendation that the "GET" method should be used when the form processing is "idempotent" (i.e. it has no lasting observable effect on the state of the world), then the form method should be GET. Many database searches have no visible side-effects and make ideal applications of query forms, and in those cases only. As a simplification, we might say that "GET" is basically for just getting (retrieving) data whereas "POST" may involve anything, like storing or updating data, or ordering a product, or sending E-mail.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;If the service associated with the processing of a form has side effects (i.e. modification of a database or subscription to a service), the method should be POST. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;Maximum URL length in GET is 2083 characters in IE.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34762507-115878688960380468?l=phpcoders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpcoders.blogspot.com/feeds/115878688960380468/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34762507&amp;postID=115878688960380468' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/115878688960380468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34762507/posts/default/115878688960380468'/><link rel='alternate' type='text/html' href='http://phpcoders.blogspot.com/2006/09/what-are-differences-between-get-and.html' title='What are the differences between Get and post methods in form submitting?'/><author><name>Sunny Jangira</name><uri>http://www.blogger.com/profile/03644086757372279849</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>1</thr:total></entry></feed>
