<?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:blogger='http://schemas.google.com/blogger/2008' 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-4807330928966747674</id><updated>2024-11-06T08:15:19.106+05:30</updated><category term="php"/><category term="php functions"/><category term="Introduction"/><category term="html"/><category term="css"/><category term="javascript"/><category term="MySQL"/><category term="firefox"/><category term="php bugs-errors"/><category term="php interview questions"/><category term="MySQL functions"/><title type='text'>PHP scripts and programs for Beginner to Master</title><subtitle type='html'>php programs, php ready to use scripts &amp;amp; functions, css tutorials, html, javascripts, ajax examples for Beginner to Master</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>49</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-8521158861227602693</id><published>2012-01-21T17:50:00.000+05:30</published><updated>2012-01-21T17:50:25.020+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="php functions"/><title type='text'>PHP Math functions Ceil and Floor</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
PHP has nice support for Mathematical processing. And for doing rounding off we generally need functions like ceil() and floor().&lt;br /&gt;
&lt;br /&gt;
Lets see how to use these functions...&lt;br /&gt;
&lt;br /&gt;
PHP ceil() Function&lt;br /&gt;
&lt;br /&gt;
The ceil() function rounds the value &quot;UPWARDS&quot; to the nearest integer.&lt;br /&gt;
&lt;br /&gt;
Check the code below&lt;br /&gt;
&lt;br /&gt;
&lt;textarea class=&quot;php&quot; name=&quot;code&quot;&gt;echo ceil(0.55);
&lt;/textarea&gt;
&lt;br /&gt;
The output of the above code will be 1.&lt;br /&gt;
&lt;br /&gt;
PHP floor() Function&lt;br /&gt;
&lt;br /&gt;
The floor() function rounds off the value &quot;DOWNWARDS&quot; to the nearest integer.
&lt;br /&gt;
Check the code below&lt;br /&gt;
&lt;textarea class=&quot;php&quot; name=&quot;code&quot;&gt;echo floor(0.55);
&lt;/textarea&gt;
&lt;br /&gt;
The output of the above code will be 0. &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/8521158861227602693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2012/01/php-math-functions-ceil-and-floor.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/8521158861227602693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/8521158861227602693'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2012/01/php-math-functions-ceil-and-floor.html' title='PHP Math functions Ceil and Floor'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-7720869503647923306</id><published>2010-04-19T10:03:00.005+05:30</published><updated>2010-04-19T12:10:29.887+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>Count number of rows with php mysql</title><content type='html'>This is a small script which will help you find the number of rows from a mysql database for your query.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://programming-in-php.blogspot.com/2009/08/create-database-connection-file-in-php.html&quot;&gt;First connect to your database, just create a database connection file.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;textarea name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;// Connect to the database&lt;br /&gt;&lt;br /&gt;include &quot;connect.php&quot;;&lt;br /&gt;&lt;br /&gt;// Query the database and get the count&lt;br /&gt;&lt;br /&gt;$result = mysql_query(&quot;SELECT * FROM tablename&quot;);&lt;br /&gt;&lt;br /&gt;$num_rows = mysql_num_rows($result);&lt;br /&gt;&lt;br /&gt;// Display the results&lt;br /&gt;&lt;br /&gt;echo $num_rows;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;so now you can use this $num_rows variable throughout your program for any manipulation.</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/7720869503647923306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2010/04/count-number-of-rows-with-php-mysql.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/7720869503647923306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/7720869503647923306'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2010/04/count-number-of-rows-with-php-mysql.html' title='Count number of rows with php mysql'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-3694345900723159205</id><published>2010-03-01T15:47:00.012+05:30</published><updated>2010-03-02T11:18:52.313+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="css"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>Create Guestbook / Shoutbox in php, mysql with css</title><content type='html'>Hi everyone,&lt;br /&gt;Today i am going to show you how to Create Guestbook / Shoutbox in php mysql, in a very easy way and with simple code.&lt;br /&gt;First thing that you might be thinking is what is a Guestbook or Shoutbox ?&lt;br /&gt;These are the places where your website visitors or users can type their views or some information in a simple box.&lt;br /&gt;In this program we are going to create a simple shoutbox / Guestbook which will allow your website visitor to enter some simple data about your website.&lt;br /&gt;&lt;br /&gt;So lets start,&lt;br /&gt;First we need to create the table which will store our data into database.&lt;br /&gt;Create the table structure in your MySQL database as follows&lt;br /&gt;&lt;br /&gt;&lt;textarea name=&#39;code&#39; class=&#39;html&#39;&gt;&lt;br /&gt;&lt;br /&gt;CREATE TABLE `guests` (&lt;br /&gt;  `id` int(10) NOT NULL auto_increment,&lt;br /&gt;  `name` varchar(50) NOT NULL default &#39;&#39;,&lt;br /&gt;  `message` varchar(255) NOT NULL default &#39;&#39;,&lt;br /&gt;  `date` varchar(50) default &#39;CURRENT_TIMESTAMP&#39;,&lt;br /&gt;  `guestip` varchar(30) NOT NULL default &#39;&#39;,&lt;br /&gt;  PRIMARY KEY  (`id`)&lt;br /&gt;) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=51 ;&lt;br /&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;After creating database and table you need to create a database connection file.&lt;br /&gt;If you don&#39;t know how to create a database connection file then &lt;a href=&quot;http://programming-in-php.blogspot.com/2009/08/create-database-connection-file-in-php.html&quot;&gt;you should check this&lt;/a&gt;.&lt;br /&gt;Specify the settings in database connection file.&lt;br /&gt;&lt;br /&gt;Now we will be creating a form which will accept user&#39;s name and their shout or opinion.&lt;br /&gt;So lets design it. &lt;br /&gt;If the form is not posted then we will display the form and show the existing records from the database.&lt;br /&gt;&lt;br /&gt;&lt;pre name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;br /&gt;if (!isset($_POST[&quot;submit&quot;])) &lt;br /&gt;{&lt;br /&gt; $query = &quot;SELECT id, name, message, DATE_FORMAT(date, &#39;%D %M, %Y&#39;) as newdate FROM guests ORDER BY id DESC LIMIT 0, 8&quot;;&lt;br /&gt;    $result = mysql_query($query);&lt;br /&gt;?&gt;&lt;br /&gt;&lt;div id=&quot;myform&quot;&gt;&lt;br /&gt;&lt;p&gt;Post a message&lt;/p&gt;&lt;br /&gt;&lt;form method=&quot;post&quot; action=&quot;&quot; name=&quot;form1&quot;&gt;&lt;br /&gt;&lt;br /&gt;    &lt;p&gt;&lt;label for=&quot;name&quot;&gt;Name:&lt;/label&gt;&lt;br /&gt;&lt;br /&gt;    &lt;input name=&quot;name&quot; type=&quot;text&quot; title=&quot;Enter your name&quot; size=&quot;30&quot; maxlength=&quot;50&quot; /&gt;&lt;br /&gt;    &lt;/p&gt; &lt;br /&gt;    &lt;p&gt;&lt;label for=&quot;msg&quot;&gt;Your message:&lt;/label&gt;&lt;br /&gt;&lt;br /&gt;    &lt;textarea name=&quot;msg&quot; cols=&quot;30&quot; rows=&quot;5&quot; title=&quot;Enter your message&quot;&gt;&lt;/textarea&gt;&lt;br /&gt;    &lt;/p&gt;&lt;br /&gt;    &lt;p&gt;&lt;label title=&quot;Send your message&quot;&gt;&lt;br /&gt;    &lt;input type=&quot;submit&quot; value=&quot;Send&quot; name=&quot;submit&quot;/&gt;&lt;/label&gt;&lt;/p&gt;    &lt;br /&gt;&lt;br /&gt;&lt;/form&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div id=&quot;comments&quot;&gt;&lt;br /&gt;&lt;?php&lt;br /&gt; while ($row = mysql_fetch_object($result)) &lt;br /&gt; {&lt;br /&gt; ?&gt;&lt;br /&gt; &lt;div class=&#39;name&#39;&gt;&lt;h4&gt;&lt;?php echo $row-&gt;message; ?&gt;&lt;/h4&gt;&lt;br /&gt; &lt;span class=&quot;date&quot;&gt;Posted by &lt;b&gt;&lt;?php echo $row-&gt;name; ?&gt;&lt;/b&gt; on &lt;?php echo $row-&gt;newdate; ?&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt; &lt;?php&lt;br /&gt;    } &lt;br /&gt; ?&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt; &lt;?php&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So now you will see a form which will show you a textbox and a textarea for entering name and some shout. Just enter name and shout and click submit.&lt;br /&gt;&lt;br /&gt;Now is the actual part of entering shout into database and come back to entry page. &lt;br /&gt;So now we will be checking if the form is submitted then we will process the form.&lt;br /&gt;&lt;br /&gt;For security we will be adding a simple spam comment prevention logic, we will not allow one ip to enter more than 5 shouts, comments to our form on same day.&lt;br /&gt;&lt;br /&gt;&lt;pre name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;br /&gt;$name = stripslashes($_POST[&#39;name&#39;]);&lt;br /&gt;$message = stripslashes($_POST[&#39;msg&#39;]);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if(isset($_POST[&quot;submit&quot;]))&lt;br /&gt;{&lt;br /&gt;    // Add new entry to the database&lt;br /&gt; $ip = $_SERVER[&#39;REMOTE_ADDR&#39;];&lt;br /&gt; $now = date(&quot;Y-m-d&quot;);&lt;br /&gt;&lt;br /&gt; $query1 = &quot;SELECT * FROM guests WHERE guestip=&#39;$ip&#39; and date =&#39;$now&#39;&quot;;&lt;br /&gt;    $result1 = mysql_query($query1);&lt;br /&gt; $cnt = mysql_num_rows($result1);&lt;br /&gt;&lt;br /&gt; if($cnt&lt;5)&lt;br /&gt; { &lt;br /&gt;  $now = date(&quot;Y-m-d&quot;);&lt;br /&gt;  $query = &quot;INSERT INTO guests (name, message, date, guestip) VALUES (&#39;$name&#39;,&#39;$message&#39;,&#39;$now&#39;,&#39;$ip&#39;)&quot;;&lt;br /&gt;  $result = mysql_query($query) or die(mysql_error());  &lt;br /&gt;  // go back to entry page&lt;br /&gt;  $referer = $_SERVER[&#39;HTTP_REFERER&#39;];&lt;br /&gt;  header (&quot;Location: $referer&quot;);&lt;br /&gt; }&lt;br /&gt; else&lt;br /&gt; {&lt;br /&gt;  echo &quot;Thank you for your comments. But you cannot submit more comments today as its a spam prevention mechanism to avoid spammers.&quot;;&lt;br /&gt;  echo &quot;&lt;br&gt;If you are a spammer then just GO away.&quot;;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And you are done. Our shoutbox is ready to accept your website viewers shouts.&lt;br /&gt;&lt;br /&gt;Now some interesting part to design your form and display with css&lt;br /&gt;&lt;br /&gt;&lt;pre name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;style type=&quot;text/css&quot;&gt;&lt;br /&gt;body {&lt;br /&gt; font-family: Georgia, &quot;Times New Roman&quot;, Times, serif;&lt;br /&gt;}&lt;br /&gt;#myform {&lt;br /&gt; width:300px;&lt;br /&gt; /*height:300px;*/&lt;br /&gt; border:solid 5px #CCCCCC;&lt;br /&gt; padding:5px;&lt;br /&gt; margin:5px;&lt;br /&gt; background:#98BBE7;&lt;br /&gt; color:#FFFFFF;&lt;br /&gt; font-weight:bold;&lt;br /&gt;}&lt;br /&gt;.name {&lt;br /&gt; border:solid 1px; &lt;br /&gt; padding:0px;&lt;br /&gt; margin:5px;&lt;br /&gt;}&lt;br /&gt;h4 {&lt;br /&gt; background: #CCCCCC;&lt;br /&gt; color: #000000;&lt;br /&gt; padding:3px;&lt;br /&gt; margin:0px;&lt;br /&gt;}&lt;br /&gt;.date {&lt;br /&gt; font-size:12px; &lt;br /&gt; padding:2px;&lt;br /&gt;}&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So you are ready with a nice looking shoutbox.&lt;br /&gt;See here is the full source code for your testing&lt;br /&gt;&lt;br /&gt;&lt;pre name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;//code&lt;br /&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;// Database Settings&lt;br /&gt;&lt;br /&gt;include &quot;connect.php&quot;;&lt;br /&gt;&lt;br /&gt;//connecting to databae and selecting database&lt;br /&gt;mysql_connect($host, $user, $pass) OR die (&quot;Error connecting to the server.&quot;);&lt;br /&gt;mysql_select_db($db) OR die(&quot;Error selecting the database.&quot;);     &lt;br /&gt;&lt;br /&gt;$name = stripslashes($_POST[&#39;name&#39;]);&lt;br /&gt;$message = stripslashes($_POST[&#39;msg&#39;]);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if(isset($_POST[&quot;submit&quot;]))&lt;br /&gt;{&lt;br /&gt;    // Add new entry to the database&lt;br /&gt; $ip = $_SERVER[&#39;REMOTE_ADDR&#39;];&lt;br /&gt; $now = date(&quot;Y-m-d&quot;);&lt;br /&gt;&lt;br /&gt; $query1 = &quot;SELECT * FROM guests WHERE guestip=&#39;$ip&#39; and date =&#39;$now&#39;&quot;;&lt;br /&gt;    $result1 = mysql_query($query1);&lt;br /&gt; $cnt = mysql_num_rows($result1);&lt;br /&gt;&lt;br /&gt; if($cnt&lt;5)&lt;br /&gt; { &lt;br /&gt;  $now = date(&quot;Y-m-d&quot;);&lt;br /&gt;  $query = &quot;INSERT INTO guests (name, message, date, guestip) VALUES (&#39;$name&#39;,&#39;$message&#39;,&#39;$now&#39;,&#39;$ip&#39;)&quot;;&lt;br /&gt;  $result = mysql_query($query) or die(mysql_error());  &lt;br /&gt;  // go back to entry page&lt;br /&gt;  $referer = $_SERVER[&#39;HTTP_REFERER&#39;];&lt;br /&gt;  header (&quot;Location: $referer&quot;);&lt;br /&gt; }&lt;br /&gt; else&lt;br /&gt; {&lt;br /&gt;  echo &quot;Thank you for your comments. But you cannot submit more comments today as its a spam prevention mechanism to avoid spammers.&quot;;&lt;br /&gt;  echo &quot;&lt;br&gt;If you are a spammer then just GO away.&quot;;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if (!isset($_POST[&quot;submit&quot;])) &lt;br /&gt;{&lt;br /&gt; $query = &quot;SELECT id, name, message, DATE_FORMAT(date, &#39;%D %M, %Y&#39;) as newdate FROM guests ORDER BY id DESC LIMIT 0, 8&quot;;&lt;br /&gt;    $result = mysql_query($query);&lt;br /&gt;?&gt;&lt;br /&gt;&lt;div id=&quot;myform&quot;&gt;&lt;br /&gt;&lt;p&gt;Post a message&lt;/p&gt;&lt;br /&gt;&lt;form method=&quot;post&quot; action=&quot;&quot; name=&quot;form1&quot;&gt;&lt;br /&gt;&lt;br /&gt;    &lt;p&gt;&lt;label for=&quot;name&quot;&gt;Name:&lt;/label&gt;&lt;br /&gt;&lt;br /&gt;    &lt;input name=&quot;name&quot; type=&quot;text&quot; title=&quot;Enter your name&quot; size=&quot;30&quot; maxlength=&quot;50&quot; /&gt;&lt;br /&gt;    &lt;/p&gt; &lt;br /&gt;    &lt;p&gt;&lt;label for=&quot;msg&quot;&gt;Your message:&lt;/label&gt;&lt;br /&gt;&lt;br /&gt;    &lt;textarea name=&quot;msg&quot; cols=&quot;30&quot; rows=&quot;5&quot; title=&quot;Enter your message&quot;&gt;&lt;/textarea&gt;&lt;br /&gt;    &lt;/p&gt;&lt;br /&gt;    &lt;p&gt;&lt;label title=&quot;Send your message&quot;&gt;&lt;br /&gt;    &lt;input type=&quot;submit&quot; value=&quot;Send&quot; name=&quot;submit&quot;/&gt;&lt;/label&gt;&lt;/p&gt;    &lt;br /&gt;&lt;br /&gt;&lt;/form&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div id=&quot;comments&quot;&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt; while ($row = mysql_fetch_object($result)) &lt;br /&gt; {&lt;br /&gt; ?&gt;&lt;br /&gt; &lt;div class=&#39;name&#39;&gt;&lt;h4&gt;&amp;lt;?php echo $row-&gt;message; ?&gt;&lt;/h4&gt;&lt;br /&gt; &lt;span class=&quot;date&quot;&gt;Posted by &lt;b&gt;&amp;lt;?php echo $row-&gt;name; ?&gt;&lt;/b&gt; on &amp;lt;?php echo $row-&gt;newdate; ?&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt; &amp;lt;?php&lt;br /&gt;    } &lt;br /&gt; ?&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt; &amp;lt;?php&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;br /&gt;&lt;style type=&quot;text/css&quot;&gt;&lt;br /&gt;body {&lt;br /&gt; font-family: Georgia, &quot;Times New Roman&quot;, Times, serif;&lt;br /&gt;}&lt;br /&gt;#myform {&lt;br /&gt; width:300px;&lt;br /&gt; /*height:300px;*/&lt;br /&gt; border:solid 5px #CCCCCC;&lt;br /&gt; padding:5px;&lt;br /&gt; margin:5px;&lt;br /&gt; background:#98BBE7;&lt;br /&gt; color:#FFFFFF;&lt;br /&gt; font-weight:bold;&lt;br /&gt;}&lt;br /&gt;.name {&lt;br /&gt; border:solid 1px; &lt;br /&gt; padding:0px;&lt;br /&gt; margin:5px;&lt;br /&gt;}&lt;br /&gt;h4 {&lt;br /&gt; background: #CCCCCC;&lt;br /&gt; color: #000000;&lt;br /&gt; padding:3px;&lt;br /&gt; margin:0px;&lt;br /&gt;}&lt;br /&gt;.date {&lt;br /&gt; font-size:12px; &lt;br /&gt; padding:2px;&lt;br /&gt;}&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Let us know whether you liked it or not. This is just a basic sample example for you.&lt;br /&gt;Its not fully secure. If you know some simple function to prevent bots using this for data entry then let me know.</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/3694345900723159205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2010/03/create-guestbook-shoutbox-in-php-mysql.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/3694345900723159205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/3694345900723159205'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2010/03/create-guestbook-shoutbox-in-php-mysql.html' title='Create Guestbook / Shoutbox in php, mysql with css'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-1664673026104710667</id><published>2010-01-19T13:57:00.003+05:30</published><updated>2010-01-19T14:04:54.477+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="php functions"/><title type='text'>How to Extract Domain name from URL ?</title><content type='html'>Hi,&lt;div&gt;Here is a simple function which can be used to parse the URL.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;http://php.net/manual/en/function.parse-url.php&quot;&gt;parse_url&lt;/a&gt; is a built in php function which can be used to parse url and get the type of request like whether its http or https or ftp, gives the domain name like www.google.com and path and the query.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;eg. consider this url - &lt;a href=&quot;http://www.chaprak.com/articles.php?cat_id=6&quot;&gt;http://www.chaprak.com/articles.php?cat_id=6&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In &lt;a href=&quot;http://www.chaprak.com/articles.php?cat_id=6&quot;&gt;http://www.chaprak.com/articles.php?cat_id=6&lt;/a&gt; this url if you execute parse_url function then it will show the following result.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;scheme - http&lt;br /&gt;url - www.chaprak.com&lt;br /&gt;path - /articles.php&lt;br /&gt;query -  cat_id=6&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;textarea name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;$url = &quot;http://www.chaprak.com/articles.php?cat_id=6&quot;;&lt;br /&gt;$parts = parse_url($url);&lt;br /&gt;print_r($parts);&lt;br /&gt;&lt;br /&gt;echo &quot;&lt;br&gt;scheme - $parts[scheme]&quot;;&lt;br /&gt;echo &quot;&lt;br&gt;url - $parts[host]&quot;;&lt;br /&gt;echo &quot;&lt;br&gt;path - $parts[path]&quot;;&lt;br /&gt;echo &quot;&lt;br&gt;query - $parts[query]&quot;;&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;For more information &lt;a href=&quot;http://php.net/manual/en/function.parse-url.php&quot;&gt;click here&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/1664673026104710667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2010/01/how-to-extract-domain-name-from-url.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/1664673026104710667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/1664673026104710667'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2010/01/how-to-extract-domain-name-from-url.html' title='How to Extract Domain name from URL ?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-7084663163171456507</id><published>2009-12-18T16:57:00.006+05:30</published><updated>2010-01-07T12:52:24.322+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>How to Get value stored in Cookie in php ?</title><content type='html'>Now you have learnt to &lt;a href=&quot;http://programming-in-php.blogspot.com/2009/12/how-to-set-urlencoded-cookie-in-php.html&quot;&gt;set a cookie in php&lt;/a&gt;. Now the next thing is to retrieve the value stored in cookie.&lt;br /&gt;&lt;br /&gt;With the following code you can retrieve the value stored in cookie.&lt;br /&gt;To get the value stored in cookie we are using global variable $_COOKIE.&lt;br /&gt;&lt;br /&gt;Here we are getting the value stored in cookie to the variable $mycookie.&lt;br /&gt;&lt;textarea name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;$mycookie = $_COOKIE[&quot;cookiename&quot;];&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;Here is full code to check &amp;amp; print the value of the cookie.&lt;br /&gt;&lt;br /&gt;&lt;textarea name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;setcookie( &quot;cookiename&quot;, &quot;cookievalue&quot;, time()+3600);&lt;br /&gt;$mycookie = $_COOKIE[&quot;cookiename&quot;];&lt;br /&gt;if ( isset( $mycookie ) )&lt;br /&gt;   print &quot;&lt;p&gt;The value in cookie - $mycookie&lt;/p&gt;&quot;;&lt;br /&gt;else&lt;br /&gt;   print &quot;&lt;p&gt;There is no value in cookie.&lt;/p&gt;&quot;;&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/textarea&gt;</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/7084663163171456507/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2009/12/how-to-get-value-stored-in-cookie-in.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/7084663163171456507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/7084663163171456507'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2009/12/how-to-get-value-stored-in-cookie-in.html' title='How to Get value stored in Cookie in php ?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-3699972434553948857</id><published>2009-12-17T15:50:00.007+05:30</published><updated>2009-12-22T12:37:01.252+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="php bugs-errors"/><title type='text'>Error while creating a cookie - Warning: Cannot modify header information...</title><content type='html'>Hi,&lt;div&gt;Are you getting this kind of error when creating a cookie or setting a cookie -&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Warning&lt;/b&gt;: Cannot modify header information - headers already sent by  (output started at e:\wamp\www\mysite\test.php:3) in  &lt;b&gt;e:\wamp\www\mysite\test.php&lt;/b&gt; on line &lt;b&gt;4&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;This error comes when some data is sent to the browser before setting the cookie.&lt;div&gt;So setcookie or setrawcookie function should be the first to be called means,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;setcookie or setrawcookie function should be the first line on your page.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;So if you use code like this&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;textarea name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;&lt;br /&gt;some html tags here or other contents or data&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;setcookie( &quot;cookiename&quot;, &quot;cookievalue&quot;, time()+3600);&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;so the above code will give error.&lt;br /&gt;&lt;br /&gt;So you should do following thing.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;textarea name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;setcookie( &quot;cookiename&quot;, &quot;cookievalue&quot;, time()+3600);&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;some html tags here or other contents or data&lt;br /&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/3699972434553948857/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2009/12/error-while-creating-cookie-warning.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/3699972434553948857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/3699972434553948857'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2009/12/error-while-creating-cookie-warning.html' title='Error while creating a cookie - Warning: Cannot modify header information...'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-1644324647377843527</id><published>2009-12-17T15:43:00.001+05:30</published><updated>2009-12-21T09:55:33.009+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="php functions"/><title type='text'>How to Set a Raw Cookie in php ?</title><content type='html'>You might be searching for how to set a raw cookie in php. So here is a simple example which shows how to set a raw cookie.&lt;br /&gt;&lt;br /&gt;To set a cookie use the function &quot;setrawcookie&quot;&lt;br /&gt;&lt;br /&gt;setrawcookie() is exactly the same as setcookie() except that the cookie value will not be automatically urlencoded when sent to the browser.&lt;br /&gt;&lt;br /&gt;This function accepts different number of arguments or parameters as setcookie. You can see the php reference manual of setcookie function &lt;a href=&quot;http://php.net/manual/en/function.setcookie.php&quot;&gt;here&lt;/a&gt; for more details.&lt;br /&gt;&lt;br /&gt;In the following example we are passing 3 parameters&lt;br /&gt;1) cookie name - its the name by which cookie will be identified.&lt;br /&gt;2) cookie value - its the value stored in cookie.&lt;br /&gt;3) expiration time - the time till the cookie will be available, after that it will be destroyed.&lt;br /&gt;&lt;br /&gt;&lt;textarea name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;&lt;?php setrawcookie( &quot;cookiename&quot;, &quot;cookievalue&quot;, time()+3600); ?&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;You can set the cookie by using above function.&lt;br /&gt;more details can be found &lt;a href=&quot;http://www.php.net/manual/en/function.setrawcookie.php&quot;&gt;here&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/1644324647377843527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2009/12/how-to-set-raw-cookie-in-php.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/1644324647377843527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/1644324647377843527'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2009/12/how-to-set-raw-cookie-in-php.html' title='How to Set a Raw Cookie in php ?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-4734599562896550727</id><published>2009-12-17T14:55:00.007+05:30</published><updated>2009-12-18T14:40:00.258+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="php functions"/><title type='text'>How to Set a urlencoded Cookie in PHP ?</title><content type='html'>You might be searching for how to set a cookie in php. So here is a simple example which shows how to set a cookie.&lt;br /&gt;&lt;br /&gt;To set a cookie use the function &quot;setcookie&quot;&lt;br /&gt;&lt;br /&gt;Note that the value portion of the cookie will automatically be urlencoded when you send the cookie, and when it is received, it is automatically decoded and assigned to a variable by the same name as the cookie name.&lt;br /&gt;&lt;br /&gt;This function accepts different number of arguments or parameters. You can see the php reference manual of setcookie function &lt;a href=&quot;http://php.net/manual/en/function.setcookie.php&quot;&gt;here&lt;/a&gt; for more details.&lt;br /&gt;&lt;br /&gt;In the following example we are passing 3 parameters&lt;br /&gt;1) cookie name - its the name by which cookie will be identified.&lt;br /&gt;2) cookie value - its the value stored in cookie.&lt;br /&gt;3) expiration time - the time till the cookie will be available, after that it will be destroyed.&lt;br /&gt;&lt;br /&gt;&lt;textarea name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;&lt;?php setcookie( &quot;cookiename&quot;, &quot;cookievalue&quot;, time()+3600); ?&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;You can set the cookie by using above function.&lt;br /&gt;more details can be found &lt;a href=&quot;http://php.net/manual/en/function.setcookie.php&quot;&gt;here&lt;/a&gt; for more details.</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/4734599562896550727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2009/12/how-to-set-urlencoded-cookie-in-php.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/4734599562896550727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/4734599562896550727'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2009/12/how-to-set-urlencoded-cookie-in-php.html' title='How to Set a urlencoded Cookie in PHP ?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-6563232371926476702</id><published>2009-12-16T11:25:00.007+05:30</published><updated>2009-12-16T11:34:33.926+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>List files of a Directory in php or List files of a folder from php code</title><content type='html'>Hi,&lt;div&gt;You might require this code which lists all files from a specific directory in php. It shows the files from a folder you want.&lt;/div&gt;&lt;div&gt;Even you can specify which files to ignore eg. when showing image you dont want to show thumbs.db file, so you can specify in the code neglect thumbs.db file.&lt;/div&gt;&lt;div&gt;So your code will show all files except thumbs.db &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is a very basic program, you can extend it to a level you want as per your requirement. If you need some help ask me, if possible definitely i will help.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;In the below code there is one array $exclude, in this array you specify the files which you want to ignore in your final output, so it will not be shown. And just modify the if loop.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;textarea name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;? &lt;br /&gt;$maindir = &quot;.&quot; ; &lt;br /&gt;$mydir = opendir($maindir) ; &lt;br /&gt;$exclude = array(&quot;index.php&quot;,&quot;test.txt&quot;) ; &lt;br /&gt;while($fn = readdir($mydir)) &lt;br /&gt;{ &lt;br /&gt;if ($fn == $exclude[0] || $fn == $exclude[1]) continue; &lt;br /&gt;echo &quot;&lt;br&gt; \n &lt;a href=&#39;$fn&#39;&gt;$fn&lt;/a&gt;&quot;; &lt;br /&gt;} &lt;br /&gt;closedir($mydir); &lt;br /&gt;?&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;If you know any other way to do the same then comments are always welcome.&lt;br /&gt;Dont forget to tell your friends about &lt;a href=&quot;http://programming-in-php.blogspot.com&quot;&gt;http://programming-in-php.blogspot.com&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/6563232371926476702/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2009/12/list-files-of-directory-in-php-or-list.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/6563232371926476702'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/6563232371926476702'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2009/12/list-files-of-directory-in-php-or-list.html' title='List files of a Directory in php or List files of a folder from php code'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-5907685138160097528</id><published>2009-11-30T11:21:00.005+05:30</published><updated>2009-11-30T11:30:52.394+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>Dropdown - On change redirect to another page</title><content type='html'>Hi,&lt;div&gt;Do you want your visitors to go to a particular page when they select any option from the dropdown list or from select box ?&lt;/div&gt;&lt;div&gt;Then here is the select element which will redirect users to the particular url when the select any option from it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;select name=&quot;test&quot; onchange=&quot;gotourl(this.value)&quot;&gt;&lt;br /&gt; &lt;option value=&quot;#&quot;&gt;Select the Site to Navigate&lt;/option&gt;&lt;br&gt;&lt;br /&gt; &lt;option value=&quot;http://www.google.com/&quot;&gt;Google&lt;/option&gt;&lt;br&gt;&lt;br /&gt; &lt;option value=&quot;http://programming-in-php.blogspot.com/&quot;&gt;PHP Programming Blog&lt;/option&gt;&lt;br&gt;&lt;br /&gt; &lt;option value=&quot;http://www.chaprak.com/&quot;&gt;Chaprak&lt;/option&gt;&lt;br&gt;&lt;br /&gt;&lt;/select&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Now whenever a user selects any option from the dropdown at that time we are calling our javascript function &lt;span style=&quot;font-weight:bold;&quot;&gt;gotourl&lt;/span&gt; which will process the current request and redirects users to that particular page.&lt;br /&gt;&lt;br /&gt;Here is our &lt;span style=&quot;font-weight:bold;&quot;&gt;Javascript function gotourl&lt;/span&gt; to do processing&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;pre name = &#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;br /&gt;&lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;&gt;&lt;br /&gt;function gotourl(url){&lt;br /&gt; window.location= url;&lt;br /&gt;}&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Here is full code &lt;br /&gt;&lt;br /&gt;&lt;pre name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;&gt;&lt;br /&gt;function gotourl(url){&lt;br /&gt; window.location= url;&lt;br /&gt;}&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;select name=&quot;test&quot; onchange=&quot;gotourl(this.value)&quot;&gt;&lt;br /&gt; &lt;option value=&quot;#&quot;&gt;Select the Site to Navigate&lt;/option&gt;&lt;br /&gt; &lt;option value=&quot;http://www.google.com/&quot;&gt;Google&lt;/option&gt;&lt;br /&gt; &lt;option value=&quot;http://programming-in-php.blogspot.com/&quot;&gt;PHP Programming Blog&lt;/option&gt;&lt;br /&gt; &lt;option value=&quot;http://www.chaprak.com/&quot;&gt;Chaprak&lt;/option&gt;&lt;br /&gt;&lt;/select&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;If you know any other way to do the same then comments are always welcome.&lt;br /&gt;Dont forget to tell your friends about &lt;a href=&quot;http://programming-in-php.blogspot.com&quot;&gt;http://programming-in-php.blogspot.com&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/5907685138160097528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2009/11/dropdown-on-change-redirect-to-another.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/5907685138160097528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/5907685138160097528'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2009/11/dropdown-on-change-redirect-to-another.html' title='Dropdown - On change redirect to another page'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-5129069442932787054</id><published>2009-11-19T16:18:00.003+05:30</published><updated>2009-11-19T16:29:11.283+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="MySQL functions"/><category scheme="http://www.blogger.com/atom/ns#" term="php interview questions"/><title type='text'>Get number of days between two dates using MySQL?</title><content type='html'>&lt;span style=&quot;font-weight:bold;&quot;&gt;How can we know the number of days between two given dates using MySQL ? or find the difference between dates using MySQL ?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Do you ever faced this question in technical interview or technical test?&lt;br /&gt;&lt;br /&gt;I know many of you have faced this....... :)&lt;br /&gt;&lt;br /&gt;Here is a simple function which can be used to find the number of days between two given dates in MySQL.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Syntax - DATEDIFF(firstdate,seconddate)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;so internally it will calculate the difference in MySQL by doing &quot;firstdate minus seconddate&quot;, so if firstdate is greater than sencoddate then output will be positive and if firstdate is less than seconddate then output will be negative.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;eg. if you use this function as &lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;SELECT DATEDIFF(&#39;2009-11-19&#39;, &#39;2009-10-15&#39;);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;in &lt;span style=&quot;font-weight:bold;&quot;&gt;MySQL&lt;/span&gt;&lt;br /&gt;then you will get output as &lt;span style=&quot;font-weight:bold;&quot;&gt;35&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;And if you pass parameters as &lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;SELECT DATEDIFF(&#39;2009-10-15&#39;,&#39;2009-11-19&#39;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;then you will get output as &lt;span style=&quot;font-weight:bold;&quot;&gt;-35&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;If you know any other way to find the difference between dates then comments are always welcome.&lt;br /&gt;Dont forget to tell your friends about &lt;a href=&quot;http://programming-in-php.blogspot.com&quot;&gt;http://programming-in-php.blogspot.com&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/5129069442932787054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2009/11/get-number-of-days-between-two-dates.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/5129069442932787054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/5129069442932787054'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2009/11/get-number-of-days-between-two-dates.html' title='Get number of days between two dates using MySQL?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-5790510397068098804</id><published>2009-11-18T11:39:00.005+05:30</published><updated>2009-11-18T12:07:06.759+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="php functions"/><category scheme="http://www.blogger.com/atom/ns#" term="php interview questions"/><title type='text'>Difference between sort &amp; asort in php ?</title><content type='html'>Many times when you go for an interview or technical test you may find this question &lt;div&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&quot;What is the difference between the sort() and asort() function in php ?&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Basically sort() and asort() functions are used to sort the array in php.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;* sort() function syntax - sort(array,sorttype)&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;sorttype is Optional. Specifies how to sort the array values.&lt;br /&gt;&lt;br /&gt;    * SORT_REGULAR - Default. Treat values as they are (dont change types)&lt;br /&gt;    * SORT_NUMERIC - Treat values numerically&lt;br /&gt;    * SORT_STRING - Treat values as strings&lt;br /&gt;    * SORT_LOCALE_STRING - Treat values as strings, based on local settings&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;This function assigns new keys for the elements in the array. Existing keys  will be deleted.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;eg. See the code below when we create array $myarray we have assigned keys as a b &amp; c.&lt;br /&gt;Now we are applying sort function and printing the array.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;textarea name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;$my_array = array(&quot;a&quot; =&gt; &quot;chaprak&quot;, &quot;b&quot; =&gt; &quot;programming&quot;, &quot;c&quot; =&gt; &quot;dexter&quot;);&lt;br /&gt;&lt;br /&gt;print_r($my_array);&lt;br /&gt;echo &quot;&lt;br&gt;&quot;;&lt;br /&gt;sort($my_array);&lt;br /&gt;echo &quot;&lt;br&gt;&quot;;&lt;br /&gt;print_r($my_array);&lt;br /&gt;echo &quot;&lt;br&gt;&quot;;&lt;br /&gt;?&gt; &lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;so the output of the above code will be -&lt;br /&gt;initial array contents - &lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Array ( [a] =&gt; chaprak [b] =&gt; programming [c] =&gt; dexter ) &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and after applying sort function - &lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Array ( [0] =&gt; chaprak [1] =&gt; dexter [2] =&gt; programming ) &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;its keys are changed to numeric values and sorting is done.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.php.net/manual/en/function.asort.php&quot;&gt;View php manual for the array sort function&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;* asort() function syntax - asort(array,sorttype)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The asort() function sorts an array by the values. The values keep their original keys (index).&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;sorttype is Optional. Specifies how to sort the array values. &lt;br /&gt;&lt;br /&gt;    * SORT_REGULAR - Default. Treat values as they are (don&#39;t change types)&lt;br /&gt;    * SORT_NUMERIC - Treat values numerically&lt;br /&gt;    * SORT_STRING - Treat values as strings&lt;br /&gt;    * SORT_LOCALE_STRING - Treat values as strings, based on local settings&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;textarea name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;$my_array = array(&quot;a&quot; =&gt; &quot;chaprak&quot;, &quot;b&quot; =&gt; &quot;programming&quot;, &quot;c&quot; =&gt; &quot;dexter&quot;);&lt;br /&gt;echo &quot;&lt;br&gt;&quot;;&lt;br /&gt;print_r($my_array);&lt;br /&gt;echo &quot;&lt;br&gt;&quot;;&lt;br /&gt;asort($my_array);&lt;br /&gt;echo &quot;&lt;br&gt;&quot;;&lt;br /&gt;print_r($my_array);&lt;br /&gt;?&gt; &lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;when we execute above code then it will produce the following output&lt;br /&gt;&lt;br /&gt;initially array contents are - &lt;span style=&quot;font-weight:bold;&quot;&gt;Array ( [a] =&gt; chaprak [b] =&gt; programming [c] =&gt; dexter )&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;after applying &lt;span style=&quot;font-weight:bold;&quot;&gt;asort()&lt;/span&gt; function the contents are - &lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Array ( [a] =&gt; chaprak [c] =&gt; dexter [b] =&gt; programming )&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;see here sorting is done and even index is maintained.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://php.net/manual/en/function.sort.php&quot;&gt;View php manual for the array sort function&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/5790510397068098804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2009/11/difference-between-sort-asort-in-php.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/5790510397068098804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/5790510397068098804'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2009/11/difference-between-sort-asort-in-php.html' title='Difference between sort &amp; asort in php ?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-1326701898989422395</id><published>2009-11-05T14:14:00.004+05:30</published><updated>2009-11-06T09:44:51.729+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="php functions"/><title type='text'>check whether the url exists or not in php</title><content type='html'>Whenever it is required to get some input url from user then the first things comes is check whether that url is working and valid or it is not working.&lt;br /&gt;&lt;br /&gt;Here is a simple function which can be used to verify the liveness of the url.&lt;br /&gt;Just pass the url to this function and it will tell you whether the url is working and valid or invalid.&lt;br /&gt;&lt;br /&gt;In the &lt;span style=&quot;font-weight:bold;&quot;&gt;function &quot;check_url&quot;&lt;/span&gt; we are going to open the given url with &lt;span style=&quot;font-weight:bold;&quot;&gt;&quot;fopen&quot;&lt;/span&gt;.&lt;br /&gt;If its opened then return true else return false.&lt;br /&gt;&lt;br /&gt;&lt;textarea name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;//php function to check whether the url exists or not and validate it&lt;br /&gt;function check_url($url)&lt;br /&gt;{&lt;br /&gt;$check = @fopen($url,&quot;r&quot;); // we are opening url with fopen&lt;br /&gt;if($check)&lt;br /&gt; $status = true;&lt;br /&gt;else&lt;br /&gt; $status = false;&lt;br /&gt; &lt;br /&gt;return $status;&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;Now we are going to use this function.&lt;br /&gt;you can pass the url from the GET or POST method to the function.&lt;br /&gt;Here we are going to specify it directly in the code.&lt;br /&gt;So we are asking our code to open the url &lt;a href=&quot;http://www.chaprak.com&quot;&gt;http://www.chaprak.com&lt;/a&gt; with our function.&lt;br /&gt;&lt;br /&gt;&lt;textarea name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;//$url = $_GET[&quot;url&quot;]; // you can get the parameter from GET&lt;br /&gt;$url = &quot;http://www.chaprak.com&quot;;&lt;br /&gt;if(check_url($url))&lt;br /&gt;{&lt;br /&gt; echo &quot;&lt;div&gt;&lt;a href=$url&gt;$url&lt;/a&gt; is a &lt;b&gt;valid&lt;/b&gt; URL&lt;/div&gt;&quot;;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt; echo &quot;&lt;div&gt;&lt;a href=$url&gt;$url&lt;/a&gt; is a &lt;b&gt;invalid&lt;/b&gt; URL&lt;/div&gt;&quot;;&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;so after execution it will show the message as &lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.chaprak.com&quot;&gt;http://www.chaprak.com&lt;/a&gt; is a valid URL.&lt;br /&gt;&lt;br /&gt;See its very simple to check the validity of the url in php.&lt;br /&gt;&lt;br /&gt;Full source code to try is here - &lt;br /&gt;&lt;br /&gt;&lt;textarea name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;//a function to check whether the url exists or not and validate it&lt;br /&gt;function check_url($url)&lt;br /&gt;{&lt;br /&gt;$check = @fopen($url,&quot;r&quot;); // we are opening url with fopen&lt;br /&gt;if($check)&lt;br /&gt; $status = true;&lt;br /&gt;else&lt;br /&gt; $status = false;&lt;br /&gt; &lt;br /&gt;return $status;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//$url = $_GET[&quot;url&quot;]; // you can get the parameter from GET&lt;br /&gt;$url = &quot;http://www.chaprak.com&quot;;&lt;br /&gt;if(check_url($url))&lt;br /&gt;{&lt;br /&gt; echo &quot;&lt;div&gt;&lt;a href=$url&gt;$url&lt;/a&gt; is a &lt;b&gt;valid&lt;/b&gt; URL&lt;/div&gt;&quot;;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt; echo &quot;&lt;div&gt;&lt;a href=$url&gt;$url&lt;/a&gt; is a &lt;b&gt;invalid&lt;/b&gt; URL&lt;/div&gt;&quot;;&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;If you have any ideas and suggestions to improve this function then comments are always welcome.&lt;br /&gt;Dont forget to tell your friends about &lt;a href=&quot;http://programming-in-php.blogspot.com&quot;&gt;http://programming-in-php.blogspot.com&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/1326701898989422395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2009/11/check-whether-url-exists-or-not-in-php.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/1326701898989422395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/1326701898989422395'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2009/11/check-whether-url-exists-or-not-in-php.html' title='check whether the url exists or not in php'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-6546437357976198330</id><published>2009-11-03T14:04:00.004+05:30</published><updated>2009-11-03T14:31:56.204+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="php functions"/><title type='text'>function to count number of words in string in php</title><content type='html'>Here is a simple function which can be used to count the total number of words present in a string in php.&lt;br /&gt;&lt;br /&gt;For this function we are going to use inbuilt functions in php like &lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;count, explode, trim.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Function is very simple, it accepts the text.&lt;br /&gt;Then we are checking if there are any extra spaces before and after the string, if it is there then removing that with &lt;span style=&quot;font-weight:bold;&quot;&gt;trim&lt;/span&gt; function.&lt;br /&gt;&lt;br /&gt;Then we are using &lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;count&lt;/span&gt;&lt;/span&gt; and &lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;explode&lt;/span&gt;&lt;/span&gt; function.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://programming-in-php.blogspot.com/2009/09/split-string-with-php-explode-function.html&quot;&gt;Explode&lt;/a&gt; will divide the text into array. (for more information on how explode works visit our post &lt;a href=&quot;http://programming-in-php.blogspot.com/2009/09/split-string-with-php-explode-function.html&quot;&gt;Split string with php explode function and print array&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;Then we are counting the total number of array elements by using count function.&lt;br /&gt;&lt;br /&gt;&lt;textarea name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;//This function can be used to count the number of words present in a string in php&lt;br /&gt;function countwords($text)&lt;br /&gt;{ &lt;br /&gt; $text = trim($text);&lt;br /&gt; $count = count(explode(&quot; &quot;, $text));&lt;br /&gt; return $count;&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;Now we are actually going to use this function.&lt;br /&gt;&lt;br /&gt;&lt;textarea name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;$mytext = &quot;Here you can get value from textarea&quot;;&lt;br /&gt;echo &quot;String Contains &quot;.countwords($mytext).&quot; Words.&quot;;&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;Here is a full source code to try it out.&lt;br /&gt;&lt;br /&gt;&lt;textarea name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;//This function can be used to count the number of words present in a string in php&lt;br /&gt;function countwords($text)&lt;br /&gt;{ &lt;br /&gt; $text = trim($text);&lt;br /&gt; $count = count(explode(&quot; &quot;, $text));&lt;br /&gt; return $count;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$mytext = &quot;Here you can get value from textarea&quot;;&lt;br /&gt;echo &quot;String Contains &quot;.countwords($mytext).&quot; Words.&quot;;&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;If you have any ideas and suggestions to improve this function then comments are always welcome.&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/6546437357976198330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2009/11/function-to-count-number-of-words-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/6546437357976198330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/6546437357976198330'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2009/11/function-to-count-number-of-words-in.html' title='function to count number of words in string in php'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-1705560176562584524</id><published>2009-10-30T11:17:00.006+05:30</published><updated>2009-10-30T11:37:57.391+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="php functions"/><title type='text'>function to show read more link in php</title><content type='html'>Have you ever came across a situation where you need to truncate the large text and show the &quot;&lt;span style=&quot;font-weight:bold;&quot;&gt;read more..&lt;/span&gt;&quot; link to redirect user to read the full post ?&lt;br /&gt;I know you might be searching for a function to show read more link in php.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Here is our simple function which can be used to show the &quot;Read more..&quot; links dynamically.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;textarea name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;//function to truncate text and show read more link&lt;br /&gt;function truncate($mytext,$link,$var,$id) {&lt;br /&gt;//Number of characters to show&lt;br /&gt;$chars = 25;&lt;br /&gt;$mytext = substr($mytext,0,$chars);&lt;br /&gt;$mytext = substr($mytext,0,strrpos($mytext,&#39; &#39;));&lt;br /&gt;$mytext = $mytext.&quot; &lt;a href=&#39;$link?$var=$id&#39;&gt;read more...&lt;/a&gt;&quot;;&lt;br /&gt;return $mytext;&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;The above function can be used anywhere to show read more links with dynamic mysql queries.&lt;br /&gt;&lt;br /&gt;How to use this function ???&lt;br /&gt;Here is a simple example to do this&lt;br /&gt;First you will need to create the connection with the database.&lt;br /&gt;Connection settings are stored in &quot;&lt;a href=&quot;http://programming-in-php.blogspot.com/2009/08/create-database-connection-file-in-php.html&quot;&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;connect.php&lt;/span&gt;&lt;/a&gt;&quot; file&lt;br /&gt;&lt;br /&gt;&lt;textarea name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;include &quot;connect.php&quot;;&lt;br /&gt;$sql = &quot;SELECT * FROM articles&quot;;&lt;br /&gt;$result = mysql_query($sql);&lt;br /&gt;while($row = mysql_fetch_array($result))&lt;br /&gt;{&lt;br /&gt;echo &quot;\n&quot;;&lt;br /&gt;echo truncate($row[&#39;article_text&#39;],&quot;article.php&quot;,&quot;article_id&quot;,$row[&#39;article_id&#39;]);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//function to truncate text and show read more link&lt;br /&gt;function truncate($mytext,$link,$var,$id) {&lt;br /&gt;//Number of characters to show&lt;br /&gt;$chars = 25;&lt;br /&gt;$mytext = substr($mytext,0,$chars);&lt;br /&gt;$mytext = substr($mytext,0,strrpos($mytext,&#39; &#39;));&lt;br /&gt;$mytext = $mytext.&quot; &lt;a href=&#39;$link?$var=$id&#39;&gt;read more...&lt;/a&gt;&quot;;&lt;br /&gt;return $mytext;&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This will output your article text with proper linking to original post with read more link.&lt;br /&gt;&lt;br /&gt;Even you can customize the truncate function for more security check and customizing your display.&lt;br /&gt;&lt;br /&gt;Share with friends if you liked it.</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/1705560176562584524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2009/10/function-to-show-read-more-link-in-php.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/1705560176562584524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/1705560176562584524'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2009/10/function-to-show-read-more-link-in-php.html' title='function to show read more link in php'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-2284530087981914664</id><published>2009-10-26T09:56:00.004+05:30</published><updated>2009-10-26T10:26:29.592+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Introduction"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>How to create and execute, run php file on windows</title><content type='html'>So you &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;a href=&quot;http://programming-in-php.blogspot.com/2009/10/how-to-use-php-on-windows.html&quot;&gt;installed WampServer on Windows&lt;/a&gt;&lt;/span&gt;.&lt;div&gt;Now how to create and execute or run you php file on windows ???&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;START&lt;/span&gt; WampServer by clicking your &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;START MENU&lt;/span&gt; and then selecting &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;WampServer&lt;/span&gt; and then click &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;start WampServer.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Once Server is started then you will see a WampServer icon in the right corner of your taskbar where your clock is present.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now open the drive where you installed your wampserver.(ex. C:/wamp/)&lt;/div&gt;&lt;div&gt;Then open the www folder. (ex. C:/wamp/www/)&lt;/div&gt;&lt;div&gt;This is your Base directory, your all projects will come here.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now create a directory here named &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;mytest.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Now open notepad or any other text editor you have. Type the following in it.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;textarea name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;phpinfo();&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Save the file to the directory &lt;span style=&quot;font-weight:bold;&quot;&gt;mytest&lt;/span&gt; as index.php&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;Now click on the icon present in the right hand side of your taskbar and then click on &lt;span style=&quot;font-weight:bold;&quot;&gt;localhost&lt;/span&gt;&lt;br /&gt;Now you will see the list of projects, then click on &lt;span style=&quot;font-weight:bold;&quot;&gt;mytest&lt;/span&gt;, you can see that your program is executed.&lt;br /&gt;It will show you all the details of the php version you have installed.&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/2284530087981914664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2009/10/how-to-create-and-execute-run-php-file.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/2284530087981914664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/2284530087981914664'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2009/10/how-to-create-and-execute-run-php-file.html' title='How to create and execute, run php file on windows'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-8953499626478549101</id><published>2009-10-25T09:43:00.005+05:30</published><updated>2009-10-26T10:44:50.773+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Introduction"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>How to use PHP on Windows - WampServer</title><content type='html'>Many of us use windows operating system and want to know how to use php on Windows operating system ?&lt;br /&gt;&lt;br /&gt;For this there is a very simple and useful solution. Even you don&#39;t have to setup &amp;amp; configure many things.&lt;br /&gt;&lt;br /&gt;Following things are required for using php on windows&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Apache Server&lt;/li&gt;&lt;li&gt;Mysql&lt;/li&gt;&lt;li&gt;PHP&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;a href=&quot;http://www.wampserver.com/en/&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;WampServer&lt;/span&gt;&lt;/a&gt; is a Windows web development environment. With this we can create web applications with Apache, PHP and the MySQL database. Even PHPMyAdmin is provided to manage your databases.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Just &lt;a href=&quot;http://www.wampserver.com/dl.php&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;Download WampServer&lt;/span&gt;&lt;/a&gt; and install it and you are done. WampServer is an open source project, free to use.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Once Installation is complete then &lt;a href=&quot;http://programming-in-php.blogspot.com/2009/10/how-to-create-and-execute-run-php-file.html&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;click here to know how to create and execute(run) a php file on windows.&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/8953499626478549101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2009/10/how-to-use-php-on-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/8953499626478549101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/8953499626478549101'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2009/10/how-to-use-php-on-windows.html' title='How to use PHP on Windows - WampServer'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-8594370347459605796</id><published>2009-10-23T13:57:00.000+05:30</published><updated>2010-01-05T16:34:59.408+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Introduction"/><title type='text'>Share your blog links, blogs, websites</title><content type='html'>Hi Friends, &lt;a href=&quot;http://programming-in-php.blogspot.com/&quot;&gt;&lt;b&gt;programming-in-php.blogspot.com&lt;/b&gt;&lt;/a&gt; is a place to share experience and knowledge. &lt;div&gt;You can Help us to spread the word either by forwarding this URL or putting this on your blog or website. &lt;/div&gt;&lt;div&gt;Even I am thinking of putting a section which will list the useful resources for programming, so &lt;b&gt;if you have a blog or website which is related to php, php codes, php scripts, ajax, css, html,open source or if its technical blog then please contact me by writing a comment here about your blog, i will definitely like to add your link here on my blog. &lt;/b&gt;&lt;/div&gt;&lt;div&gt;Because to share our knowledge it has to be accessible to other many people. So lets help each other to share knowledge.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;We all can have a section on our blog or website to share some useful resources which also helps in link building &amp;amp; SEO(Search Engine Optimization) and promotion.&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Your comments are always welcome about this idea, whether is good or bad.&lt;/div&gt;&lt;div&gt;I am waiting for your reply.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Thank you.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/8594370347459605796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2009/12/share-your-blog-links-blogs-websites.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/8594370347459605796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/8594370347459605796'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2009/12/share-your-blog-links-blogs-websites.html' title='Share your blog links, blogs, websites'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-246878851247194055</id><published>2009-10-07T15:48:00.011+05:30</published><updated>2009-10-07T16:36:55.579+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>Send Feedback or contact via mail function in php</title><content type='html'>At many places we require the contact us or feedback form to get some input from the user or to get some feedback from the user.&lt;br /&gt;Today i will be showing you how to create a very simple feedback form or contact us form in php with the mail function and without any database.&lt;br /&gt;&lt;br /&gt;1) First we will be creating a simple form to accept the user input like name, email and their message or feedback or query.&lt;br /&gt;&lt;br /&gt;&lt;pre name=&#39;code&#39; class=&#39;html&#39;&gt;&lt;br /&gt;&lt;br /&gt;&lt;form id=&quot;form1&quot; name=&quot;form1&quot; method=&quot;post&quot; action=&quot;&quot;&gt;&lt;br /&gt;&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;&lt;br /&gt;  &lt;tr&gt;&lt;br /&gt;    &lt;td width=&quot;19%&quot;&gt;Name : &lt;/td&gt;&lt;br /&gt;    &lt;td width=&quot;81%&quot;&gt;&lt;input name=&quot;name&quot; type=&quot;text&quot; id=&quot;name&quot; class=&quot;textbox&quot; value=&quot;&lt;?php echo $_POST[&quot;name&quot;]; ?&gt;&quot;/&gt;&lt;/td&gt;&lt;br /&gt;  &lt;/tr&gt;&lt;br /&gt;  &lt;tr&gt;&lt;br /&gt;    &lt;td&gt;Email : &lt;/td&gt;&lt;br /&gt;    &lt;td&gt;&lt;input name=&quot;email&quot; type=&quot;text&quot; id=&quot;email&quot; class=&quot;textbox&quot; value=&quot;&lt;?php echo $_POST[&quot;email&quot;]; ?&gt;&quot;/&gt;&lt;/td&gt;&lt;br /&gt;  &lt;/tr&gt;&lt;br /&gt;  &lt;tr&gt;&lt;br /&gt;    &lt;td&gt;Message : &lt;/td&gt;&lt;br /&gt;    &lt;td&gt;&lt;textarea name=&quot;message&quot; id=&quot;message&quot; class=&quot;textarea&quot; rows=&quot;5&quot;&gt;&lt;?php echo $_POST[&quot;message&quot;]; ?&gt;&lt;/textarea&gt;&lt;/td&gt;&lt;br /&gt;  &lt;/tr&gt;&lt;br /&gt;  &lt;tr&gt;&lt;br /&gt;    &lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;br /&gt;    &lt;td&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Submit&quot; /&gt;&lt;/td&gt;&lt;br /&gt;  &lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;/form&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;2) In the form tag we have not specified any action part and we kept action=&quot;&quot; in the form tag, so when the form is submitted at that time it will call itself. &lt;br /&gt;So on submit we will execute our code to send the mail.&lt;br /&gt;&lt;br /&gt;&lt;pre name=&#39;code&#39; class=&#39;html&#39;&gt;&lt;br /&gt;&lt;form id=&quot;form1&quot; name=&quot;form1&quot; method=&quot;post&quot; action=&quot;&quot;&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;3) some css for the form and good look.&lt;br /&gt;&lt;pre name=&#39;code&#39; class=&#39;html&#39;&gt;&lt;br /&gt;.textbox,.textarea {&lt;br /&gt;width:300px;&lt;br /&gt;border:solid 2px #00CCFF;&lt;br /&gt;padding:3px;&lt;br /&gt;margin:10px;&lt;br /&gt;}&lt;br /&gt;.error {&lt;br /&gt;background: #FBBFDC;&lt;br /&gt;color:#EF013D;&lt;br /&gt;border:solid 1px;&lt;br /&gt;padding:5px;&lt;br /&gt;margin:5px;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;4) After the page is submitted we will process the form data.&lt;br /&gt;&lt;br /&gt;&lt;textarea name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;if(isset($_POST[&quot;Submit&quot;]))&lt;br /&gt;{	&lt;br /&gt;	$email = $_POST[&quot;email&quot;];&lt;br /&gt;	$msg = $_POST[&quot;message&quot;];&lt;br /&gt;	$username = $_POST[&quot;name&quot;];&lt;br /&gt;	if($username!=&quot;&quot; and $email!=&quot;&quot; and $msg!=&quot;&quot;)&lt;br /&gt;	{&lt;br /&gt;		sendmail($username,$email,&quot;&quot;,$msg,&quot;&quot;);&lt;br /&gt;	}&lt;br /&gt;	else&lt;br /&gt;	{&lt;br /&gt;		echo &quot;&lt;div class=&#39;error&#39;&gt;Fill all the fields ! Thank you.&lt;/div&gt;&quot;;&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;5) When the form is filled then we will be calling a function sendmail.&lt;br /&gt;&lt;br /&gt;&lt;textarea name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;function sendmail($username,$email,$data,$msg,$footer)&lt;br /&gt;{		&lt;br /&gt;		$to=&quot;youremailidhere&quot;;&lt;br /&gt;		$headers  = &quot;MIME-Version: 1.0\r\n&quot;;&lt;br /&gt;		$headers .= &quot;Content-type: text/html; charset=iso-8859-1\r\n&quot;;&lt;br /&gt;		//$headers .= &quot;From: &quot;.$from.&quot;\r\n&quot;;&lt;br /&gt;		$headers .= &quot;From: $username &lt;$email&gt;\r\n&quot;;&lt;br /&gt;		$headers .= &quot;Reply-To: youremailidhere\r\n&quot;;&lt;br /&gt;&lt;br /&gt;		$body=&quot;&lt;div align=left&gt;&lt;p&gt;Dear Admin,&lt;/p&gt;&quot;;&lt;br /&gt;		$body.=&quot;&lt;p&gt;Message from : $username&lt;/p&gt;&quot;;&lt;br /&gt;		$body.=&quot;&lt;p&gt;Email id : $email&lt;/p&gt;&quot;;&lt;br /&gt;		$body.=&quot;&lt;p&gt;Message : $msg&lt;/p&gt;&quot;;&lt;br /&gt;		&lt;br /&gt;		$body.=&quot;Feedback end&lt;/p&gt;&quot;;&lt;br /&gt;&lt;br /&gt;		if(@mail($to,&#39;feedback from http://programming-in-php.blogspot.com&#39;,$body,$headers))&lt;br /&gt;		{&lt;br /&gt;			echo &quot;Thank you for your valuable feedback !&quot;;&lt;br /&gt;		}&lt;br /&gt;		else&lt;br /&gt;		{&lt;br /&gt;			echo &quot;&lt;div class=&#39;error&#39;&gt;Can&#39;t send email ! ! !&lt;/div&gt;&quot;;&lt;br /&gt;		}&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;Finally, merge all the code to create a simple contact us form or feedback form.&lt;br /&gt;Full source code is here for your reference&lt;br /&gt;&lt;br /&gt;&lt;pre name=&#39;code&#39; class=&#39;html&#39;&gt;&lt;br /&gt;&lt;br /&gt;.textbox,.textarea {&lt;br /&gt;width:300px;&lt;br /&gt;border:solid 2px #00CCFF;&lt;br /&gt;padding:3px;&lt;br /&gt;margin:10px;&lt;br /&gt;}&lt;br /&gt;.error {&lt;br /&gt;background: #FBBFDC;&lt;br /&gt;color:#EF013D;&lt;br /&gt;border:solid 1px;&lt;br /&gt;padding:5px;&lt;br /&gt;margin:5px;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;form id=&quot;form1&quot; name=&quot;form1&quot; method=&quot;post&quot; action=&quot;&quot;&gt;&lt;br /&gt;&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;&lt;br /&gt;  &lt;tr&gt;&lt;br /&gt;    &lt;td width=&quot;19%&quot;&gt;Name : &lt;/td&gt;&lt;br /&gt;    &lt;td width=&quot;81%&quot;&gt;&lt;input name=&quot;name&quot; type=&quot;text&quot; id=&quot;name&quot; class=&quot;textbox&quot; value=&quot;&lt;?php echo $_POST[&quot;name&quot;]; ?&gt;&quot;/&gt;&lt;/td&gt;&lt;br /&gt;  &lt;/tr&gt;&lt;br /&gt;  &lt;tr&gt;&lt;br /&gt;    &lt;td&gt;Email : &lt;/td&gt;&lt;br /&gt;    &lt;td&gt;&lt;input name=&quot;email&quot; type=&quot;text&quot; id=&quot;email&quot; class=&quot;textbox&quot; value=&quot;&lt;?php echo $_POST[&quot;email&quot;]; ?&gt;&quot;/&gt;&lt;/td&gt;&lt;br /&gt;  &lt;/tr&gt;&lt;br /&gt;  &lt;tr&gt;&lt;br /&gt;    &lt;td&gt;Message : &lt;/td&gt;&lt;br /&gt;    &lt;td&gt;&lt;textarea name=&quot;message&quot; id=&quot;message&quot; class=&quot;textarea&quot; rows=&quot;5&quot;&gt;&lt;?php echo $_POST[&quot;message&quot;]; ?&gt;&lt;/textarea&gt;&lt;/td&gt;&lt;br /&gt;  &lt;/tr&gt;&lt;br /&gt;  &lt;tr&gt;&lt;br /&gt;    &lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;br /&gt;    &lt;td&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Submit&quot; /&gt;&lt;/td&gt;&lt;br /&gt;  &lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;/form&gt;&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;if(isset($_POST[&quot;Submit&quot;]))&lt;br /&gt;{	&lt;br /&gt;	$email = $_POST[&quot;email&quot;];&lt;br /&gt;	$msg = $_POST[&quot;message&quot;];&lt;br /&gt;	$username = $_POST[&quot;name&quot;];&lt;br /&gt;	if($username!=&quot;&quot; and $email!=&quot;&quot; and $msg!=&quot;&quot;)&lt;br /&gt;	{&lt;br /&gt;		sendmail($username,$email,&quot;&quot;,$msg,&quot;&quot;);&lt;br /&gt;	}&lt;br /&gt;	else&lt;br /&gt;	{&lt;br /&gt;		echo &quot;&lt;div class=&#39;error&#39;&gt;Fill all the fields ! Thank you.&lt;/div&gt;&quot;;&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;function sendmail($username,$email,$data,$msg,$footer)&lt;br /&gt;{		&lt;br /&gt;		$to=&quot;youremailidhere&quot;;&lt;br /&gt;		$headers  = &quot;MIME-Version: 1.0\r\n&quot;;&lt;br /&gt;		$headers .= &quot;Content-type: text/html; charset=iso-8859-1\r\n&quot;;&lt;br /&gt;		//$headers .= &quot;From: &quot;.$from.&quot;\r\n&quot;;&lt;br /&gt;		$headers .= &quot;From: $username &lt;$email&gt;\r\n&quot;;&lt;br /&gt;		$headers .= &quot;Reply-To: youremailidhere\r\n&quot;;&lt;br /&gt;&lt;br /&gt;		$body=&quot;&lt;div align=left&gt;&lt;p&gt;Dear Admin,&lt;/p&gt;&quot;;&lt;br /&gt;		$body.=&quot;&lt;p&gt;Message from : $username&lt;/p&gt;&quot;;&lt;br /&gt;		$body.=&quot;&lt;p&gt;Email id : $email&lt;/p&gt;&quot;;&lt;br /&gt;		$body.=&quot;&lt;p&gt;Message : $msg&lt;/p&gt;&quot;;&lt;br /&gt;		&lt;br /&gt;		$body.=&quot;Feedback end&lt;/p&gt;&quot;;&lt;br /&gt;&lt;br /&gt;		if(@mail($to,&#39;feedback from http://programming-in-php.blogspot.com&#39;,$body,$headers))&lt;br /&gt;		{&lt;br /&gt;			echo &quot;Thank you for your valuable feedback !&quot;;&lt;br /&gt;		}&lt;br /&gt;		else&lt;br /&gt;		{&lt;br /&gt;			echo &quot;&lt;div class=&#39;error&#39;&gt;Can&#39;t send email ! ! !&lt;/div&gt;&quot;;&lt;br /&gt;		}&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/246878851247194055/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2009/10/send-feedback-via-email-without.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/246878851247194055'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/246878851247194055'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2009/10/send-feedback-via-email-without.html' title='Send Feedback or contact via mail function in php'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-2718460995964421235</id><published>2009-10-06T14:48:00.003+05:30</published><updated>2009-10-06T14:55:01.072+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>get current working directory in php - simple function</title><content type='html'>sometimes it is required to get the current working directory of the script.&lt;br /&gt;so to get the current working directory in php this is a small function.&lt;br /&gt;&lt;br /&gt;&lt;textarea name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;echo getcwd();&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;/textarea&gt;</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/2718460995964421235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2009/10/get-current-working-directory-in-php.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/2718460995964421235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/2718460995964421235'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2009/10/get-current-working-directory-in-php.html' title='get current working directory in php - simple function'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-2939886013413878554</id><published>2009-09-24T10:33:00.001+05:30</published><updated>2009-09-24T10:37:33.801+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>Show random quotes on page every time a page is refreshed</title><content type='html'>This code can be used to show some random quotes or random links every time the page is loaded or refreshed.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;pre name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;$quote = array(&lt;br /&gt;1  =&gt; &quot;Random Quote 1&quot;,&lt;br /&gt;2  =&gt; &quot;This is sample quote 2&quot;,&lt;br /&gt;3  =&gt; &quot;check &lt;a href=&#39;http://programming-in-php.blogspot.com&#39;&gt;http://programming-in-php.blogspot.com&lt;/a&gt;&quot;,&lt;br /&gt;4  =&gt; &quot;it really works&quot;,&lt;br /&gt;5  =&gt; &quot;wooooooooooooooooooooow&quot;,&lt;br /&gt;6 =&gt; &quot;I am on twitter&quot;&lt;br /&gt;); &lt;br /&gt;$randnum = rand(1,6);&lt;br /&gt;echo &quot;&lt;div id=&#39;quotes&#39; style=&#39;border:solid 1px; padding:5px; margin:5px;&#39;&gt;Random Quote - &lt;b&gt;$quote[$randnum]&lt;/b&gt;&lt;/div&gt;&quot;; &lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/2939886013413878554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2009/09/show-random-quotes-on-page-every-time.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/2939886013413878554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/2939886013413878554'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2009/09/show-random-quotes-on-page-every-time.html' title='Show random quotes on page every time a page is refreshed'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-3122845698191336409</id><published>2009-09-13T15:47:00.002+05:30</published><updated>2009-09-17T14:22:13.882+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>Split string with php explode function and print array</title><content type='html'>If it is needed to Split string in php and then use those splitted values for some processing in that case you can use this script which Splits string with php explode function and prints array.&lt;br /&gt;&lt;br /&gt;&lt;pre name=&#39;code&#39; class=&#39;php&#39;&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;$string = &quot;Contents of the string can be splitted by explode function.&quot;;&lt;br /&gt;$splitted = explode(&quot; &quot;,$string);&lt;br /&gt;$cnt = count($splitted);&lt;br /&gt;$i=0;&lt;br /&gt;while($cnt &gt; $i)&lt;br /&gt;{&lt;br /&gt; echo &quot;$splitted[$i]&quot;;&lt;br /&gt; echo &quot;\n&quot;;&lt;br /&gt; $i++;&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/3122845698191336409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2009/09/split-string-with-php-explode-function.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/3122845698191336409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/3122845698191336409'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2009/09/split-string-with-php-explode-function.html' title='Split string with php explode function and print array'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-1435781350029121124</id><published>2009-09-12T18:19:00.000+05:30</published><updated>2009-09-17T08:06:14.688+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type='text'>Caution while using JavaScript</title><content type='html'>&lt;b&gt;Caution:&lt;/b&gt; While using Javascript and an alert message is fired using a timer, then keep the timer for atleast 10 seconds, i.e. 10000. Else, the system will hang. I experienced it recently.&lt;br /&gt;&lt;br /&gt;Please note.</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/1435781350029121124/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2009/09/caution-while-using-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/1435781350029121124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/1435781350029121124'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2009/09/caution-while-using-javascript.html' title='Caution while using JavaScript'/><author><name>Vijay Srini</name><uri>http://www.blogger.com/profile/09644637044166630119</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-187051570646671383</id><published>2009-09-11T17:16:00.000+05:30</published><updated>2009-09-17T08:03:29.356+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type='text'>Javascript Acceleration</title><content type='html'>Run this program, and watch the color change accelerate.&lt;br /&gt;&lt;br /&gt;&lt;textarea name=&#39;code&#39; class=&#39;html&#39;&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;br /&gt;var c=-1;&lt;br /&gt;var tmr;&lt;br /&gt;ntimer=1000;&lt;br /&gt;var ArrColor=new Array();&lt;br /&gt;ArrColor[0]=&quot;green&quot;;&lt;br /&gt;ArrColor[1]=&quot;blue&quot;;&lt;br /&gt;ArrColor[2]=&quot;red&quot;;&lt;br /&gt;ArrColor[3]=&quot;#ffffff&quot;;&lt;br /&gt;function showpos()&lt;br /&gt;{&lt;br /&gt;if(c==3) c=0;&lt;br /&gt;else c++;&lt;br /&gt;if(ntimer&lt;=5) ntimer=1000;&lt;br /&gt;else ntimer = ntimer-5;&lt;br /&gt;document.body.style.backgroundColor=ArrColor[c];&lt;br /&gt;clearTimeout(tmr);&lt;br /&gt;tmr=setTimeout(&quot;showpos()&quot;, ntimer);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;tmr=setTimeout(&quot;showpos()&quot;, ntimer);&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&lt;p&gt;Run this program, and watch it accelerate, slowly and slowly.&lt;/p&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/textarea&gt;</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/187051570646671383/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2009/09/javascript-acceleration.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/187051570646671383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/187051570646671383'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2009/09/javascript-acceleration.html' title='Javascript Acceleration'/><author><name>Vijay Srini</name><uri>http://www.blogger.com/profile/09644637044166630119</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4807330928966747674.post-8218175733628841993</id><published>2009-09-10T13:43:00.000+05:30</published><updated>2009-09-16T14:42:47.660+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="css"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><title type='text'>This is for Horizontal Menu.</title><content type='html'>This part is for Horizontal Menu using CSS.&lt;br /&gt;&lt;br /&gt;The below one will come under the Head Tag.&lt;br /&gt;&lt;textarea name=&#39;code&#39; class=&#39;html&#39;&gt;&lt;br /&gt;&lt;br /&gt;&lt;style type=&quot;text/css&quot;&gt;&lt;br /&gt;ul&lt;br /&gt;{&lt;br /&gt;float:left;&lt;br /&gt;width:100%;&lt;br /&gt;padding:0;&lt;br /&gt;margin:0;&lt;br /&gt;list-style-type:none;&lt;br /&gt;}&lt;br /&gt;a&lt;br /&gt;{&lt;br /&gt;float:left;&lt;br /&gt;width:6em;&lt;br /&gt;text-decoration:none;&lt;br /&gt;color:white;&lt;br /&gt;background-color:purple;&lt;br /&gt;padding:0.2em 0.6em;&lt;br /&gt;border-right:1px solid white;&lt;br /&gt;}&lt;br /&gt;a:hover {background-color:#ff3300}&lt;br /&gt;li {display:inline}&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;The below one will come under Body Tag.&lt;br /&gt;&lt;br /&gt;&lt;textarea name=&#39;code&#39; class=&#39;html&#39;&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link one&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link two&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link three&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link four&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;In the example above, we let the ul element and the a element float to the left.&lt;br /&gt;The li elements will be displayed as inline elements (no line break before or after the element). This forces the list to be on one line.&lt;br /&gt;The ul element has a width of 100% and each hyperlink in the list has a width of 6em (6 times the size of the current font).&lt;br /&gt;We add some colors and borders to make it more fancy.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;This code was taken from http://www.w3schools.com/css/tryit.asp?filename=trycss_float5</content><link rel='replies' type='application/atom+xml' href='http://programming-in-php.blogspot.com/feeds/8218175733628841993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programming-in-php.blogspot.com/2009/09/this-is-for-horizontal-menu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/8218175733628841993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4807330928966747674/posts/default/8218175733628841993'/><link rel='alternate' type='text/html' href='http://programming-in-php.blogspot.com/2009/09/this-is-for-horizontal-menu.html' title='This is for Horizontal Menu.'/><author><name>Vijay Srini</name><uri>http://www.blogger.com/profile/09644637044166630119</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>