<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>GeekScribes</title>
	
	<link>http://www.geekscribes.net/blog</link>
	<description>Bringing geekiness to the world</description>
	<lastBuildDate>Fri, 19 Mar 2010 09:34:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Geekscribes" /><feedburner:info uri="geekscribes" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license><image><url>http://www.feedburner.com/fb/images/pub/fb_pwrd.gif</url></image><feedburner:emailServiceId>Geekscribes</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>PHP Lessons 9: Session and Cookies</title>
		<link>http://feedproxy.google.com/~r/Geekscribes/~3/ZxSgq_CNjMQ/</link>
		<comments>http://www.geekscribes.net/blog/2010/03/19/php-lessons-9-session-and-cookies/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 09:34:20 +0000</pubDate>
		<dc:creator>Guest-GS</dc:creator>
				<category><![CDATA[PHP Lessons]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Lessons]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.geekscribes.net/blog/?p=780</guid>
		<description><![CDATA[Hello there, back with some PHP lessons. It&#8217;s been quite a while. Got loads of projects to deal with at work and wasn&#8217;t feeling like typing codes at home.
This lesson will deal about session ($_SESSION) and cookies ($_COOKIES)&#8230;(This kind of cookie has nothing to do with cookies our grand-mother used to cook for us  [...]<p>This article comes from <a href="http://www.geekscribes.net/blog">GeekScribes</a><br/><br/><a href="http://www.geekscribes.net/blog/2010/03/19/php-lessons-9-session-and-cookies/">PHP Lessons 9: Session and Cookies</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Hello there, back with some PHP lessons. It&#8217;s been quite a while. Got loads of projects to deal with at work and wasn&#8217;t feeling like typing codes at home.</p>
<p>This lesson will deal about session ($_SESSION) and cookies ($_COOKIES)&#8230;(This kind of cookie has nothing to do with cookies our grand-mother used to cook for us <img src='http://www.geekscribes.net/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  )</p>
<p><span id="more-780"></span></p>
<p><strong>SESSIONS:</strong></p>
<p><strong>What are session and how can they be useful?</strong></p>
<p>Sessions in PHP are meant to keep track and store data for a particular user while they browse our site or pages. For example, with a login system, when the user logs in, PHP must have a way to keep track of the user&#8217;s status and with this kind of info, we can allow registered user to access private areas and so on. We can also store other data like what time they logged on, and show messages like: &#8220;You&#8217;ve been here for X minutes&#8221;.</p>
<p>When you start a SESSION, a random Session Id is stored in a COOKIE and the default name is PHPSESSID. Yes, even if it&#8217;s a SESSION, the value is also stored in a COOKIE an placed on your computer. The advantage of SESSION is, even if the user has cookies disable on his browser, SESSION will still keep track of user info, because, SESSION not only adds PHPSESSID to a cookie, but all values you assign to a SESSION, are also stored in a file on your server.</p>
<p><strong>How do we start a SESSION?</strong></p>
<p>The answer is simple, you just have to add this line on code on top of your page, before any html or php code whatsoever. It HAS to be at the very top, else you can get error messages.</p>
<pre>&lt;?php
    session_start();

    //other stuff below
?&gt;
</pre>
<p>Author&#8217;s note : Sometimes, when declaring session_start(), you might get a fancy notice which will drive you crazy. I will tell you about it later in this chapter.</p>
<p>Let&#8217;s try something with SESSION. We will declare a SESSION, assign a value to it, and retrieve the value. Code&#8217;s below:</p>
<pre>&lt;?php
     session_start(); 

     $_SESSION['view'] = 1; // assign value to session
     echo "Pageviews = ". $_SESSION['view']; //retrieving the value
?&gt;
</pre>
<p>Let&#8217;s analyze this,</p>
<p>1) We declared our session on top of everything.<br />
2) we assigned the value of 1 to the SESSION array at position &#8220;view&#8221;: $_SESSION['view']. We hence called the SESSION, &#8220;view&#8221;. Yep, $_SESSION is just an array!<br />
3) We echo out the value of the SESSION.</p>
<p>If you run this code, it will print 1. Cool huh?</p>
<p>With this, we can determine how many times a page has been viewed. The code below:</p>
<pre>&lt;?php
    session_start();  //declare session

    if(isset($_SESSION['view']))
       $_SESSION['view'] = $_SESSION['view']  + 1;

    else
       $_SESSION['view'] = 1;

   echo 'You viewed this page '. $_SESSION['view'].' times.';
?&gt;   
</pre>
<p>This one looks a bit different, we added a condition to check the value of our SESSION.</p>
<p>First, if the session is already set (isset()), We just add 1 to it. According to our condition here, if it&#8217;s there, lets just increment it, else we default the value to one.</p>
<p>If you try this code, keeps refreshing your page, and you will see the numbers increasing in value as you refresh.</p>
<p>As you already noticed by now, $_SESSION is also an Array.</p>
<pre>&lt;?php
   session_start();

   $_SESSION['firstname']   = 'John'; // Assign value to session called firstname. (Hello again, Mr. John!)
   $_SESSION['lastname']    = 'Dingo';
   $_SESSION['age']         = '18';
   $_SESSION['location']    = 'Mauritius';
   $_SESSION['sex']         = 'Male';

   echo '&lt;pre&gt;';
      print_r($_SESSION);
   echo '&lt;/pre&gt;';
?&gt;</pre>
<p>Try the code above, it will print an array of the $_SESSION we declare, and yes, it will echo ALL the session we declare, including the view $_SESSION from before. But now, why is it echoing out a $_SESSION that we didn&#8217;t declare in the script above? Well, remember, SESSION are being stored on a file on your server. The $_SESSION called &#8220;view&#8221; is still in there and we are looking at a complete Array of all SESSIONS that has been set.</p>
<p>How do we get rid of this view SESSION then?</p>
<p>In order to achieve this, we have to unset the session view. The name says it all because the built-in function we are going to use is called : unset();</p>
<p>Try the code below:</p>
<pre>&lt;?php
   session_start();

   $_SESSION['firstname']  = 'John'; // You again, Mr. John?
   $_SESSION['lastname']   = 'Dingo'; //
   $_SESSION['age']        = '18';
   $_SESSION['location']   = 'Mauritius';
   $_SESSION['sex']        = 'Male';

   unset($_SESSION['view']); //gets rid of the view 

   echo '&lt;pre&gt;';
      print_r($_SESSION);
   echo '&lt;/pre&gt;';
?&gt;
</pre>
<p>Refresh your page and TADA! the $_SESSION called view is gone. Now, since $_SESSION is an array. We can use the foreach() loop as well as the for() loop to deal with Multidimensional Arrays. <img src='http://www.geekscribes.net/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Let&#8217;s experiment. Code below:</p>
<pre>&lt;?php
    session_start();

    $_SESSION['msg'] = array(); //We assign our message session as an empty array;

    $_SESSION['msg']['msg_one'] = 'Hello this is message one.';
    $_SESSION['msg']['msg_two'] = 'Hello this is message two.';
    $_SESSION['msg']['msg_three'] = 'Hello this is message three.';

    echo $_SESSION['msg']; // This will only output Array to our browser. So we don't see any values

    echo '&lt;hr /&gt;';

    if(is_array($_SESSION['msg'])){
       foreach($_SESSION['msg'] as $myMsg){
          echo $myMsg.'&lt;br /&gt;';
       }        
    }

?&gt;
</pre>
<p>As you can see here, when we  echo $_SESSION['msg'];, it only outputs Array to our browser. We need to access the data in this array. Remember the foreach loop? It comes in handy there, we are iterating over the Array and outputting it&#8217;s value. The results will look like this:</p>
<pre>Hello this is message one.</pre>
<pre>Hello this is message two.</pre>
<pre>Hello this is message three.
</pre>
<p>You will notice a new little function called is_array(). This is a built-in function that checks if the argument being pass in an array. This function returns true or false, in our case, it will return true since $_SESSION['msg'] was set as an array to begin with.</p>
<p>Sometimes, these built-in functions comes in handy especially when you&#8217;re dealing with dynamically generated data.</p>
<p>You can start a session, but you can also destroy a session. Yes, you can. How?</p>
<p>Just by adding session_destroy() in your script.</p>
<p>Note that, when you close all your browsers, the session is automatically destroyed or cleared if you prefer. But some browsers like Mozilla Firefox sometimes asks you if you would like to save data before closing, if you choose yes, then I believe all the SESSIONS are preserved.</p>
<p>Earlier, i told about session_start() generating an ugly PHP Notice. This is true. Even if it&#8217;s a built-in function. How come? Well, let me explain something. In your PHP Configuration (php.ini file), there a line which says:</p>
<pre>session.auto_start = 0 or session.auto_start = 1
</pre>
<p>What this means is, when &#8217;session.auto_start = 1&#8242;, PHP has the power to start a session for you automatically, without you having to put session_start() at top of your script and if it is 0, then you will have to add session_start() at top of your script. PHP starting a session automatically for me. Cool huh? Not so quick pals, this can cause some serious damage later. Follow on.</p>
<p>Let&#8217;s assume the server your using right now, has session.auto_start set to 1. With this, you might say, ok, PHP is doing it for me, so I won&#8217;t bother adding session_start() in my script. But, what if you move your site on another server, and this another server PHP configuration has session.auto_start set to 0? That means your scripts won&#8217;t work and you will get some ugly error messages and yes YOU will have to go in your scripts and add session_start() everywhere where your scripts are using session.</p>
<p>Now, since we are good programmers, we must find a way to make our scripts cross-server. Bypassing this problem is actually quite easy. When a session is declared, a session_id is being generated. Remember, I told you that at the beginning of the lesson? In PHP, you can check if a session_id exist. We use the session_id() built-in function. With this, we can make a condition to bypass our problem. Code below:</p>
<pre>&lt;?php
   if(!session_id()) { session_start(); }

   $_SESSION['msg'] = array(); //We assign our message session as an empty array;

   $_SESSION['msg']['msg_one'] = 'Hello this is message one.';
   $_SESSION['msg']['msg_two'] = 'Hello this is message two.';
   $_SESSION['msg']['msg_three'] = 'Hello this is message three.';

   echo $_SESSION['msg']; // This will only output Array to our browser. So we don't see any values

   echo '&lt;hr /&gt;';

   if(is_array($_SESSION['msg'])){
      foreach($_SESSION['msg'] as $myMsg){
         echo $myMsg.'&lt;br /&gt;';
?&gt;
</pre>
<p>Have a look at the very first line in the code above. The condition says, if there&#8217;s no session_id, then we use the session_start. This will get rid of the pain <img src='http://www.geekscribes.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . I strongly advise that you use this method when starting a session. Believe me, it will save you some time later.</p>
<p>That&#8217;s it for $_SESSION. Moving on with $_COOKIES.</p>
<p><strong>Cookies</strong></p>
<p>Unlike the cookies we used to eat, this one is a bit tricky and less tasty, and the syntax is different from SESSION. We don&#8217;t start a cookie, we SET a cookie. I believe you all know what browser Cookies are. It&#8217;s a way to store data on the users computer in small files.</p>
<p>When a website places a cookie on your PC, it&#8217;s to determine wether you have been on this site recently. Usually when you login on a website, there&#8217;s a checkbox which says &#8220;Remember Me&#8221;, if you check it, the script will place a cookie on you computer, after two days, when you go to that same site, the script will check if a cookie exist, if it is, you won&#8217;t have to login again, you&#8217;re already logged in. Cool huh .. The syntax for COOKIE is below:</p>
<pre>setcookie(name, value, expire, path, domain, secure); 

name     = the name of the cookie
value    = the value of the cookie
expire   = the amount of time the cookie will remain alive
path     = which path on your server you want the cookie to be accessible
domain   = the domain that the cookie is available
secure   = Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client.
</pre>
<p>Below is an example of how to work with cookie:</p>
<pre>&lt;?php

    if(isset($_COOKIE['username'])){
       echo "You were there recently ".$_COOKIE['username']." Nice to have you back pal";
    }
    else{
       echo "Hi, you're new here. What is you name?";
       setcookie('username','John',time()+3600,'/');
    }

?&gt;</pre>
<p>In the code above, we first make a condition to see if a $_COOKIE name &#8216;username&#8217; was set. If it was, then it means the user was here recently. Else, it&#8217;s his first time, so we show him a message stating that his new, and then, we set a cookie using the setcookie function.</p>
<p>We named our cookie username, we gave it a value of John ( In this example, the value can be anything ), then we set the expire time, in our case, the cookie will expire in 1 hour (in seconds, 1 hour = 3600 seconds). The last parameter is the path; I want this cookie to be accessible everywhere on my server. After expiry, it means the cookie is no longer valid. If the user returned after say, 5 hours, he&#8217;ll get the message destined to new users. This is useful when you have checkboxes like &#8220;Remember me for a day&#8221;. Set the expiry of the cookie to one day, and you&#8217;re done.</p>
<p>You will notice that I omitted the domain and secure parameter, it is optional.</p>
<p>If you run the code, you will get: <strong>Hi, you&#8217;re new here. What is you name?</strong>&#8230; and a cookie will be set.</p>
<p>But if you refresh it again, you will get: <strong>You were here recently John. Nice to have you back pal!</strong>, since our condition saw a cookie named &#8220;check&#8221;.</p>
<p>Remember, John is the value of our cookie, that&#8217;s why we get his name in th first if statement.</p>
<p>To get an entire $_COOKIE Array, just run the code below:</p>
<pre>&lt;?php

   echo '&lt;pre&gt;';
   print_r($_COOKIE);
   echo '&lt;/pre&gt;';

?&gt;
</pre>
<p>You might get a big Array along with a bunch of values, depending on how many sites has a cookie on your PC <img src='http://www.geekscribes.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Now that we know how to set a cookie, but how do I delete the cookie? Interesting question. Unlike SESSION, a cookie cannot be delete using the unset() function, neither exist a built-in function call destroy_cookie(). You can&#8217;t go on deleting files on the user&#8217;s machine, can you?</p>
<p>To delete a cookie, you simply set the expire time in the past.:</p>
<p>Code below:</p>
<pre>&lt;?php

   if(isset($_COOKIE['username'])){
      setcookie('username','john',time()-3600,'/');
      echo 'Cookie has been deleted.';
   }

   echo '&lt;pre&gt;';
      print_r($_COOKIE);
   echo '&lt;/pre&gt;';
?&gt;
</pre>
<p>In our if statement, have a look at the setcookie function and analyze the parameters, something has changed. Notice the time()-3600 . Before we did time()+3600. But we wanted to erase it, so we defined the time 1 hour in the past. This will get rid of the cookie. Have a look at the Array, you will notice that John isn&#8217;t there anymore. He&#8217;s gone. Poor guy. He&#8217;ll be back, don&#8217;t worry.</p>
<p>Cool, we know how to set a cookie. But what about that time() function you keep talking about?</p>
<p>Well, PHP allows you to work with time. The function time() doesn&#8217;t actually return something like 19:50:23. Instead,it returns the current time as a UNIX TimeStamp (the number of seconds since January 1 1970 00:00:00 GMT). This is used as a reference time point to know much time elapsed. It&#8217;s the computer&#8217;s way of asking: &#8220;How long has it before you have eaten?&#8221;. So you figure out when you last ate, check what time it is now, and do a substraction and say, &#8220;5 mins ago&#8221;.If you echo time(), you will get something similar to this:</p>
<pre>1268422287</pre>
<p>Yes,a bunch of numbers. What the hell is that? That&#8217;s how a computer knows &#8220;Now&#8221;. 7 seconds ago would be:</p>
<pre>1268422280</pre>
<p>I want a good formatted time. Ok, to compensate for the delay of the PHP Lessons, I will show you some examples of how you can format a date and time using the number of seconds return by time(). The time() function, doesn&#8217;t take any parameters. In order to get a nice format of the date and time. We should use the date() function in addition with the time() function. Example below:</p>
<pre>&lt;?php
   echo 'Current time is : '. date('Y-m-d H:i:s',time()); // outputs Current time is : 2010-03-12 23:35:40
?&gt;
</pre>
<p>This code will give you the current time. Well, depending on your server, you might get a time 4 hours earlier than that. If that&#8217;s the case, to get the current time, you will need to offset your date() function. Example below:</p>
<pre>&lt;?php
   echo 'Current time is : '. date('Y-m-d H:i:s',time() + 14400);
?&gt;
</pre>
<p>You already noticed, we added 14400 with the time() function. Why 14400? Little maths below:</p>
<pre>1 minutes           = 60 seconds, So
1 hour              = 60 minutes, So to get the numbers of seconds in 1 hour, we do
1 hour in seconds   = 60 seconds * 60 minutes which = 3600

Now we know 3600 seconds equals 1 hour.
To get an offset of 4 hours, we multiply 3600 by 4. The result is 14400.
</pre>
<p>Next we add it to our time() function. Isn&#8217;t PHP great?</p>
<p>To get a list of available format of date and time, I strongly suggest you visit this link : http://php.net/manual/en/function.date.php.</p>
<p>While i&#8217;m at my little &#8216;compensating for the delay of lesson&#8217;, let&#8217;s go back in the past where we used to talk about user defined function.</p>
<p>This is a bonus for you.</p>
<p>When we create our own function, we can pass in arguments, as many as we want. What if one day, our function requires unlimited number of arguments? Supposed some numbers are being returned from a database, we want to make some maths or whatever with those numbers, and it so happens we are getting about 1000 rows of numbers. Are we going to write a function that takes 1000 arguments? If you have the time to type all that, then good luck. But instead of typing, let me show you how to create a function of your own, that can take unlimited amounts of args.</p>
<pre>&lt;?php
   function unlimitedArgs(){

      $arguments = func_get_args(); // returns an array of arguments passed to the function when calling it

      foreach($arguments as $args){
         return array_sum($args);
      }
   }

   $someArray = array(1,2,3,4,5);

   echo unlimitedArgs($someArray);

?&gt;
</pre>
<p>Let&#8217;s analyze, first, for a beginner, things looks weird, because we are creating a function that doesn&#8217;t take any arguments, and yet, when we call that function, we are passing an array as it&#8217;s arguments. Have a look at the function, we have this line:</p>
<pre>$arguments = func_get_args();
</pre>
<p>func_get_args() returns an array of any arguments passed to the function even if we didn&#8217;t supply it when created the function itself. This way, we can pass as many arguments as we want. In our example, our argument is an array containing numbers. Our function simply iterates over the array of arguments created by func_get_args, then we use the array_sum function to sum up all the values in the array. Our result is 15.</p>
<p>array_sum(Array) simply sum all the values in the given array.</p>
<p>Ok, I believe this is it for this lesson. If you didn&#8217;t understand the last part, comments are open for questions! <img src='http://www.geekscribes.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Nice reading.</p>
<h3 style="text-align: center;">This article was contributed by Tipa of <a title="Mu-Anime: Tipa's Site" href="http://www.mu-anime.com/" target="_blank">Mu-Anime</a></h3>
<p><div class="eg-series"><div class="eg-series-posts"><h3>PHP Lessons</h3><ul class="eg-series-posts"><li class="eg-series-posts-item "><span class="eg-series-post-title"><a href="http://www.geekscribes.net/blog/2009/08/01/php-lessons-intro-and-variables/" title="PHP Lessons Part 1: Introduction to PHP and Variables">PHP Lessons Part 1: Introduction to PHP and Variables</a></span>  - <span class="eg-series-post-date date">August 1, 2009</span></li><li class="eg-series-posts-item "><span class="eg-series-post-title"><a href="http://www.geekscribes.net/blog/2009/08/01/php-lessons-operators/" title="PHP Lessons Part 2: Operators">PHP Lessons Part 2: Operators</a></span>  - <span class="eg-series-post-date date">August 1, 2009</span></li><li class="eg-series-posts-item "><span class="eg-series-post-title"><a href="http://www.geekscribes.net/blog/2009/08/08/php-lessons-conditional-statements/" title="PHP Lessons Part 3: Conditional Statements">PHP Lessons Part 3: Conditional Statements</a></span>  - <span class="eg-series-post-date date">August 8, 2009</span></li><li class="eg-series-posts-item "><span class="eg-series-post-title"><a href="http://www.geekscribes.net/blog/2009/08/11/php-lessons-arrays/" title="PHP Lessons Part 4: Arrays">PHP Lessons Part 4: Arrays</a></span>  - <span class="eg-series-post-date date">August 11, 2009</span></li><li class="eg-series-posts-item "><span class="eg-series-post-title"><a href="http://www.geekscribes.net/blog/2009/08/14/php-lessons-loops/" title="PHP Lessons 5: Loops">PHP Lessons 5: Loops</a></span>  - <span class="eg-series-post-date date">August 14, 2009</span></li><li class="eg-series-posts-item "><span class="eg-series-post-title"><a href="http://www.geekscribes.net/blog/2009/08/15/php-lessons-break-continue/" title="PHP Lessons 6: Break and Continue">PHP Lessons 6: Break and Continue</a></span>  - <span class="eg-series-post-date date">August 15, 2009</span></li><li class="eg-series-posts-item "><span class="eg-series-post-title"><a href="http://www.geekscribes.net/blog/2009/08/17/php-lesson-functions/" title="PHP Lessons 7: Functions in PHP">PHP Lessons 7: Functions in PHP</a></span>  - <span class="eg-series-post-date date">August 17, 2009</span></li><li class="eg-series-posts-item "><span class="eg-series-post-title"><a href="http://www.geekscribes.net/blog/2009/12/10/php-lessons-8-server-constants-and-html-forms/" title="PHP Lessons 8: Server Constants and HTML Forms">PHP Lessons 8: Server Constants and HTML Forms</a></span>  - <span class="eg-series-post-date date">December 10, 2009</span></li><li class="eg-series-posts-item current"><span class="eg-series-post-title">PHP Lessons 9: Session and Cookies</span> <span class="eg-series-post-this">(This post)</span> - <span class="eg-series-post-date date">March 19, 2010</span></li></ul></div></div><br />
<h3>You might also be interested in:</h3>
<ul class="related_post">
<li><a href="http://www.geekscribes.net/blog/2009/12/10/php-lessons-8-server-constants-and-html-forms/" title="PHP Lessons 8: Server Constants and HTML Forms">PHP Lessons 8: Server Constants and HTML Forms</a></li>
<li><a href="http://www.geekscribes.net/blog/2009/08/17/php-lesson-functions/" title="PHP Lessons 7: Functions in PHP">PHP Lessons 7: Functions in PHP</a></li>
<li><a href="http://www.geekscribes.net/blog/2009/08/15/php-lessons-break-continue/" title="PHP Lessons 6: Break and Continue">PHP Lessons 6: Break and Continue</a></li>
<li><a href="http://www.geekscribes.net/blog/2009/08/14/php-lessons-loops/" title="PHP Lessons 5: Loops">PHP Lessons 5: Loops</a></li>
<li><a href="http://www.geekscribes.net/blog/2009/08/11/php-lessons-arrays/" title="PHP Lessons Part 4: Arrays">PHP Lessons Part 4: Arrays</a></li>
</ul>
<p>This article comes from <a href="http://www.geekscribes.net/blog">GeekScribes</a><br/><br/><a href="http://www.geekscribes.net/blog/2010/03/19/php-lessons-9-session-and-cookies/">PHP Lessons 9: Session and Cookies</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/Wu6v0zW-MTi8o51tRty5MYmq04Q/0/da"><img src="http://feedads.g.doubleclick.net/~a/Wu6v0zW-MTi8o51tRty5MYmq04Q/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Wu6v0zW-MTi8o51tRty5MYmq04Q/1/da"><img src="http://feedads.g.doubleclick.net/~a/Wu6v0zW-MTi8o51tRty5MYmq04Q/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Geekscribes?a=ZxSgq_CNjMQ:cFv20Wx4gtk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Geekscribes?i=ZxSgq_CNjMQ:cFv20Wx4gtk:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=ZxSgq_CNjMQ:cFv20Wx4gtk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Geekscribes?i=ZxSgq_CNjMQ:cFv20Wx4gtk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=ZxSgq_CNjMQ:cFv20Wx4gtk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Geekscribes?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=ZxSgq_CNjMQ:cFv20Wx4gtk:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Geekscribes?i=ZxSgq_CNjMQ:cFv20Wx4gtk:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=ZxSgq_CNjMQ:cFv20Wx4gtk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Geekscribes?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Geekscribes/~4/ZxSgq_CNjMQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.geekscribes.net/blog/2010/03/19/php-lessons-9-session-and-cookies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.geekscribes.net/blog/2010/03/19/php-lessons-9-session-and-cookies/</feedburner:origLink></item>
		<item>
		<title>Windows 7: Solutions to can’t sleep problems.</title>
		<link>http://feedproxy.google.com/~r/Geekscribes/~3/R6F0hcTiuoo/</link>
		<comments>http://www.geekscribes.net/blog/2010/03/02/windows-7-cannot-sleep-solutions/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 16:19:31 +0000</pubDate>
		<dc:creator>InF</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tech Posts]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Sleep]]></category>
		<category><![CDATA[Solution]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://www.geekscribes.net/blog/?p=773</guid>
		<description><![CDATA[
Hello folks. Sorry for lack of recent posts. Been taken up with uni lately. Anyway, I have recently migrated to Windows 7. I have to say Microsoft has done a magnificent job this time, especially when I compare Win7 and Vista. Performance on Win7 is awesome. And there are lots of usability improvements, which makes [...]<p>This article comes from <a href="http://www.geekscribes.net/blog">GeekScribes</a><br/><br/><a href="http://www.geekscribes.net/blog/2010/03/02/windows-7-cannot-sleep-solutions/">Windows 7: Solutions to can&#8217;t sleep problems.</a></p>
]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-774  aligncenter" title="win7-logo" src="http://www.geekscribes.net/blog/wp-content/uploads/2010/03/win7-logo.jpg" alt="win7-logo" width="214" height="214" /></p>
<p>Hello folks. Sorry for lack of recent posts. Been taken up with uni lately. Anyway, I have recently migrated to Windows 7. I have to say Microsoft has done a magnificent job this time, especially when I compare Win7 and Vista. Performance on Win7 is awesome. And there are lots of usability improvements, which makes 7 a very nice software.</p>
<p>However, I was having a problem: I couldn&#8217;t manually sleep my computer. If I did it from the Orb/Start menu, the screen would turn off, the PC would shut for like a millisecond, before starting back up, and prompting me for login.</p>
<p>Turns out there are a few things that can cause this error, and they are easy to troubleshoot. Try these steps if you are having the same problem as me.</p>
<p><strong>1) Update your drivers.</strong></p>
<p>This should be pretty obvious. An old driver might be causing an issue. So just update your drivers, specially for your video card and it should correct any problem. If it still doesn&#8217;t work, move on.</p>
<p><strong>2) Try to see which requests are keeping the PC on.</strong></p>
<p>Open a Command Prompt. You can do it by typing &#8220;<em>cmd</em>&#8221; from the Run menu, or simply open the Start Menu, and type &#8220;Command Prompt&#8221; in the &#8220;Search Programs and Files&#8221; bar.</p>
<p>Type this command: &#8220;<em>powercfg -requests</em>&#8221; without quotes. Then press Enter. You will see a list of programs that could be making requests. Windows Media Player is a usual culprit. Just close them, and it should work. If you have &#8220;None.&#8221; marked, move on.</p>
<p><strong>3) A specific device is keeping the PC from sleeping</strong></p>
<p>Still in the command prompt, type <em>&#8220;powercfg -devicequery wake_armed&#8221;</em>. You will see a list of devices that can wake up your PC. For me, I got my Network card, Keyboard and Mouse in that list. Turns out it was my mouse that was responsible for waking up the machine.</p>
<p>What to do? Simple: Go to device manager ( Start Menu &#8211; Control Panel (View by: Large Icons, top right)  &#8211; System &#8211; Device Manager (left sidebar) ). Find your device that you think is causing the problem. For me it was the mouse, but I had to try disabling each individually. So, find your mouse in that list, e.g. Mice and other pointing devices, right-click it, choose Properties and go to the Power Management tab. Uncheck the box &#8220;<em>Allow this device to wake the computer</em>&#8220;.</p>
<p>Validate the windows with Ok, close Control Panel, and you should be all ok. Try sleeping your computer now.</p>
<p>That&#8217;s it for this small guide. I hope it helps you. Step 3 solved my problem. My computer now sleeps when I want it to sleep. <img src='http://www.geekscribes.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<h3>You might also be interested in:</h3>
<ul class="related_post">
<li><a href="http://www.geekscribes.net/blog/2009/06/19/firefox-displays-weird-characters-as-headings-solution/" title="Firefox displays weird characters as headings (solution)">Firefox displays weird characters as headings (solution)</a></li>
<li><a href="http://www.geekscribes.net/blog/2009/03/05/avg-update-needs-restart-solution/" title="AVG: Update needs restart solution">AVG: Update needs restart solution</a></li>
<li><a href="http://www.geekscribes.net/blog/2010/03/19/php-lessons-9-session-and-cookies/" title="PHP Lessons 9: Session and Cookies">PHP Lessons 9: Session and Cookies</a></li>
<li><a href="http://www.geekscribes.net/blog/2009/12/10/php-lessons-8-server-constants-and-html-forms/" title="PHP Lessons 8: Server Constants and HTML Forms">PHP Lessons 8: Server Constants and HTML Forms</a></li>
<li><a href="http://www.geekscribes.net/blog/2009/09/16/phased-upgrade-of-windows-live-messenger/" title="Phased Upgrade of Windows Live Messenger 8.x">Phased Upgrade of Windows Live Messenger 8.x</a></li>
</ul>
<p>This article comes from <a href="http://www.geekscribes.net/blog">GeekScribes</a><br/><br/><a href="http://www.geekscribes.net/blog/2010/03/02/windows-7-cannot-sleep-solutions/">Windows 7: Solutions to can&#8217;t sleep problems.</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/jE4um7Gv8vDVlbvFhTkeLRVAVf4/0/da"><img src="http://feedads.g.doubleclick.net/~a/jE4um7Gv8vDVlbvFhTkeLRVAVf4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/jE4um7Gv8vDVlbvFhTkeLRVAVf4/1/da"><img src="http://feedads.g.doubleclick.net/~a/jE4um7Gv8vDVlbvFhTkeLRVAVf4/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Geekscribes?a=R6F0hcTiuoo:e5Xp18kCisk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Geekscribes?i=R6F0hcTiuoo:e5Xp18kCisk:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=R6F0hcTiuoo:e5Xp18kCisk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Geekscribes?i=R6F0hcTiuoo:e5Xp18kCisk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=R6F0hcTiuoo:e5Xp18kCisk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Geekscribes?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=R6F0hcTiuoo:e5Xp18kCisk:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Geekscribes?i=R6F0hcTiuoo:e5Xp18kCisk:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=R6F0hcTiuoo:e5Xp18kCisk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Geekscribes?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Geekscribes/~4/R6F0hcTiuoo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.geekscribes.net/blog/2010/03/02/windows-7-cannot-sleep-solutions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.geekscribes.net/blog/2010/03/02/windows-7-cannot-sleep-solutions/</feedburner:origLink></item>
		<item>
		<title>PHP Lessons 8: Server Constants and HTML Forms</title>
		<link>http://feedproxy.google.com/~r/Geekscribes/~3/m-7yeycCEFo/</link>
		<comments>http://www.geekscribes.net/blog/2009/12/10/php-lessons-8-server-constants-and-html-forms/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 14:49:56 +0000</pubDate>
		<dc:creator>Guest-GS</dc:creator>
				<category><![CDATA[PHP Lessons]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Lessons]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.geekscribes.net/blog/?p=760</guid>
		<description><![CDATA[Hello there, it&#8217;s been a while, I&#8217;ve been very busy with work and some personal project, so i had to delay the PHP courses, but anyway, I&#8217;m back and today we&#8217;ll have a look at Server Constants.
Take a look at www.geekscribes.net, on the right side, we have a search form, when you type in a [...]<p>This article comes from <a href="http://www.geekscribes.net/blog">GeekScribes</a><br/><br/><a href="http://www.geekscribes.net/blog/2009/12/10/php-lessons-8-server-constants-and-html-forms/">PHP Lessons 8: Server Constants and HTML Forms</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Hello there, it&#8217;s been a while, I&#8217;ve been very busy with work and some personal project, so i had to delay the PHP courses, but anyway, I&#8217;m back and today we&#8217;ll have a look at Server Constants.</p>
<p>Take a look at www.geekscribes.net, on the right side, we have a search form, when you type in a search keyword and press Enter, the page loads and it fetch every results according to what you typed. Ever wonder how it works? Don&#8217;t go any further, today I will show you bring a boring html form to life.</p>
<p>Before I start, if you missed the array tutorials, then please, go to the link below, and read the post, give it a try.. because you&#8217;ll need to understand how arrays work in order to understand this lesson fully.</p>
<p><span id="more-760"></span></p>
<p>Here&#8217;s the link:</p>
<p><a title="PHP Lessons on Arrays @ Geekscribes" href="http://www.geekscribes.net/blog/2009/08/11/php-lessons-arrays/" target="_blank">http://www.geekscribes.net/blog/2009/08/11/php-lessons-arrays/</a></p>
<p>So let&#8217;s begin.. Server Constants are also called Predefined Variables, which are just arrays in fact. I will list some of them, but today, we&#8217;ll have a look at two of them..Below is a list:</p>
<pre>$_SERVER:     This grabs almost all information about the server your website resides on.

$_GET:        The HTTP GET variables are in there

$_POST:       HTTP POST Variables (Very useful with forms)

$_FILES:      Used with forms also, but only for upload purposes. LIke uploading files to a server. Think Rapidshare.

$_REQUEST:    HTTP Request variables (We can say it is a mix of $_GET and $_POST.
              But don't rely on it too much. The only way to rely on it is to use the function array_map() ).
              Also, it's a bit unsecured to use this one, so avoid!

$_SESSION:    Session Variables
              (This is a handy built-in function use to store data. Like Username, Password, User Clicks.
              It can be useful, but can be hard to understand).

$_COOKIE:     HTTP Cookies.
              (This is use to store information on your computer. Like which preference you choosed for a website.
              Or if you checked Remember Me when logged in, a cookie is set on your computer.)</pre>
<p>We&#8217;ll deal with $_SESSION and $_COOKIE in a later lesson, so no worries. <img src='http://www.geekscribes.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Today, we&#8217;ll have a look at $_GET and $_POST..and in order for you to understand, we will use an HTML Form to send a Request to the server.. Now, what is &#8220;send Request to the server&#8221;? Basically, you are making a request for a resource from the server, or are sending something to it. Whatever you put in a form is sent to the server in a special message (or request). The server can then use this to determine what you want and what to do.</p>
<p>There are two methods of sending requests, namely GET and POST. When you use GET, whatever data to be sent is passed in the URL (or action) if the form, in plain text. Using POST, the data is sent in the background making the transfer invisible to the user. Following logic, you won&#8217;t be sending login information via GET since the password would be visible in the address bar in plain text. For this, you&#8217;ll use POST. For other uses, such as getting an item&#8217;s price, GET is perfectly acceptable.</p>
<p>Note, if no value is specified for the action attribute, it means that the page refers to itself. If the page is &#8220;test.php&#8221;, it&#8217;s as if action was set to &#8220;test.php&#8221;. Also, if you don&#8217;t set a method, by default it&#8217;s &#8220;GET&#8221;. So beware if you&#8217;ll be using it to send passwords etc.</p>
<pre>&lt;form method="post" action="name.php"&gt;
   &lt;label for="name"&gt;Type your name&lt;/label&gt;
   &lt;input type="text" name="name" /&gt;
   &lt;input type="submit" name="submit" value="Output my name" /&gt;
&lt;/form&gt;</pre>
<p>Ok, i won&#8217;t go through all this, you should at least have a fair knowlegde of HTML if you are studying PHP, but what I will point out is, the part where it says &#8221; &lt;form method=&#8221;post&#8221; action=&#8221;name.php&#8221;&gt; &#8221;</p>
<p>The &#8220;method&#8221; attribute in the form tag is set to post, which means we are going to use POST ( $_POST for php ) and the page to process the code is the same where our form lives, which is set in the &#8220;action&#8221; attribute of the form tag, so it&#8217;s set to nothing, which means, use the same page as our form, the PHP Code will be in the same page.</p>
<p>Ok, let&#8217;s make a test. Fire up your code editor or use the old notepad, and type that in a file, say &#8220;test.php&#8221;. It HAS to end in .php, not .html or .htm, even if it includes HTML codes. If it doesn&#8217;t end in .php, it won&#8217;t get pre-processed, and you&#8217;ll just see your PHP code in plain text.</p>
<pre>&lt;?php</pre>
<pre>  if(isset($_POST['submit']))
  {
     echo "&lt;pre&gt;";
     print_r($_POST);
     echo "&lt;/pre&gt;";
  }</pre>
<pre>?&gt;</pre>
<pre>&lt;form method="post" action=""&gt;
   &lt;label for="name"&gt;Type your name&lt;/label&gt;
   &lt;input type="text" name="name" /&gt;
   &lt;input type="submit" name="submit" value="Output my name" /&gt;
&lt;/form&gt;</pre>
<p>Type in your name in the input box, press enter and see the results.. My output was like this:</p>
<pre>Array
(
   [name] =&gt; Kevin
   [submit] =&gt; Output my name
)</pre>
<p>print_r is a function in PHP that allows you to display the contents of an array, in key-value pairs. Here, we are printing the $_POST array. I did say these are just arrays with form data stored in them. <img src='http://www.geekscribes.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The output therefore means:</p>
<p>Name: is the name of the field in our form. The text-box was called &#8220;name&#8221;<br />
Submit: is the name of the submit button ( Note: We can get rid of it from our array)</p>
<p>Note that &#8220;Output my name&#8221; is given as the value for submit. The value attribute of a submit input type is what&#8217;s displayed on the button in HTML.</p>
<p>Now that we know what&#8217;s stored in our POST Array, we can easily output it. We can acess it through the $_POST array. Like below:</p>
<pre>&lt;?php</pre>
<pre>  if(isset($_POST['submit']))
  {
     echo "My name is ". $_POST['name'];
  }</pre>
<pre>?&gt;</pre>
<pre>&lt;form method="post" action=""&gt;
   &lt;label for="name"&gt;Type your name&lt;/label&gt;
   &lt;input type="text" name="name" /&gt;
   &lt;input type="submit" name="submit" value="Output my name" /&gt;
&lt;/form&gt;</pre>
<p>So the code first check if the form has been submited:</p>
<pre>if(isset ($_POST['submit']) )</pre>
<p>If the array key named &#8220;submit&#8221; has a value (any value) set, then process the codes inside of the IF statement.</p>
<p>$_POST['name'], simply because, in our HTML FORM, the input where you typed your name, has the name attribute set to &#8220;name&#8221;. If you have another field, say, age. You would type $_POST['age'] to access it.</p>
<p>It&#8217;s all about arrays. You can also interact with it using a foreach loop. Most array operations in PHP could theoretically be performed on those $_GET, $_POST, &#8230; variables.</p>
<p>Now for the $_GET constant, unlike $_POST, the value is sent through the URL.</p>
<p>The form method is set to get instead of post! Try the code below, then look at your URL in the address bar</p>
<p>&lt;?php</p>
<pre>  if(isset($_GET['submit']))
  {
     echo "My name is ". $_GET['name'];
  }</pre>
<pre>?&gt;</pre>
<pre>&lt;form method="get" action=""&gt;
   &lt;label for="name"&gt;Type your name&lt;/label&gt;
   &lt;input type="text" name="name" /&gt;
   &lt;input type="submit" name="submit" value="Output my name" /&gt;
&lt;/form&gt;</pre>
<p>You will notice that your URL is now :</p>
<pre>http://localhost/test.php?<strong>name=Kevin</strong>&amp;<strong>submit=Output+my+name</strong></pre>
<pre>test.php:            This is the page we are using right now
test.php?name=kevin: This is the fun part. The ?name=&lt;name&gt;, is called a Query String, name is the $_GET Variable, and "kevin" is the value assigned to that variable.</pre>
<p>The query strings are separated from the domain by a &#8220;?&#8221; and are separated by ampersands. Spaces are substituted with &#8220;+&#8221; symbols. Note, there is a maximum length on the URL length, and hence the amount of data that can be sent via GET. So if you have to send a ton of data, use POST.</p>
<p>Another advice is don&#8217;t use multi-word names separated by spaces for the &#8220;name&#8221; attribute of fields. You don&#8217;t want to see: &#8220;?<strong>my+name</strong>=John+smith&#8221; in the URL. Then in PHP, you&#8217;d do $_POST['<strong>my_name</strong>'] as the space became an underscore. A whole lot of headaches! So don&#8217;t do it! For the sake of fellow programmers.</p>
<p>test.php?name=kevin&amp;submit=Output+my+name : the Submit is just the name of the submit button, you shouldn&#8217;t care about that too much</p>
<p><strong>IMPORTANT Notice: </strong>When using the $_GET Method, NEVER, and I mean NEVER use password field with it. Use $_POST when you form contains password field. Unless of course you want the whole world to see your password is in fact &#8220;password&#8221; :p</p>
<p>One thing you can try is, use the $_SERVER variable to check what the Actual URL Query string is set to. Try the code below:</p>
<pre>&lt;?php
if(isset($_GET['submit']))
  {
     echo "My name is ". $_GET['name'];
     echo "&lt;hr /&gt;"; //&lt;hr /&gt; just makes a horizontal rule (line) appear.
     echo "The URL Query String is ". $_SERVER['QUERY_STRING'];
     echo "&lt;hr /&gt;";
  }
?&gt;
&lt;form method="get" action=""&gt;
   &lt;label for="name"&gt;Type your name&lt;/label&gt;
   &lt;input type="text" name="name" /&gt;
   &lt;input type="submit" name="submit" value="Output my name" /&gt;
&lt;/form&gt;</pre>
<p>You will notice that the URL Query String is set to : name=&lt;name you typed&gt;&amp;submit=Output+my+name. That is, whatever comes after the &#8220;?&#8221; mark.</p>
<p>If you don&#8217;t want the &#8220;submit&#8221; part to appear in the URL, simply do not set the &#8220;name&#8221; and &#8220;value&#8221; attributes. Note, this works for GET only. If you used POST, the form doesn&#8217;t work unless &#8221; name=&#8221;submit&#8221; &#8221; is set.</p>
<p>A bonus: add this just after the last HR tag, you will see what the default $_SERVER Array holds. Code below:</p>
<pre>echo "&lt;pre&gt;";
print_r($_SERVER);
echo "&lt;/pre&gt;";</pre>
<p>You will get something like:</p>
<pre>Array
(
   [HTTP_HOST] =&gt; localhost
   [HTTP_USER_AGENT] =&gt; Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5
   [HTTP_ACCEPT] =&gt; text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
   [HTTP_ACCEPT_LANGUAGE] =&gt; en-gb,en;q=0.5
   [HTTP_ACCEPT_ENCODING] =&gt; gzip,deflate
   [HTTP_ACCEPT_CHARSET] =&gt; ISO-8859-1,utf-8;q=0.7,*;q=0.7
   [HTTP_KEEP_ALIVE] =&gt; 300
   [HTTP_CONNECTION] =&gt; keep-alive
   [HTTP_REFERER] =&gt; http://localhost/test.php?name=Kevin&amp;submit=Output+my+name

<em>   ... and it continues with other stuff.</em>
)</pre>
<p>That ton of details is a lot of details about your server and its current configuration.</p>
<p>Then you can experiment through the Array like:</p>
<pre>echo $_SERVER['HTTP_HOST'];</pre>
<p>Which will return &#8216;localhost&#8217;, as shown in the $_SERVER Global Array.</p>
<p>Ok, this should get you started.. Now let&#8217;s have a look at how we can get rid of the submit name into our $_POST Array. In order to accomplish this, we will use a built-in function of PHP. This is fun. Code below:</p>
<pre>&lt;?php

   if(isset($_POST['submit']))
   {
     // we use the array_pop function to get rid of the last element
     // In our case the last element is the submit button
     //Actually, it returns the last element of the array.
     //Since we are not capturing it, it's discarded. The array is shortened by 1 element.

     array_pop($_POST);
     echo "&lt;pre&gt;";
     print_r($_POST);
     echo "&lt;/pre&gt;";
     echo $_POST['name'];
   }
?&gt;

&lt;form method="post" action=""&gt;
   &lt;label for="name"&gt;Type your name&lt;/label&gt;
   &lt;input type="text" name="name" /&gt;
   &lt;input type="submit" name="submit" value="Output my name" /&gt;
&lt;/form&gt;</pre>
<p>Try the code, and you will see that unlike the previous one, the line &#8220;[submit] =&gt; Output my name&#8221; is gone. That&#8217;s how we get rid of it (Note: It will remove the submit button IF it is the last element in the array, if not, use an IF statement with a foreach loop to pull it out). Like below:</p>
<pre>&lt;?php</pre>
<pre>   if(isset($_POST['submit'])){</pre>
<pre>     foreach($_POST as $key =&gt; $post)
     {
        if($key != "submit")
        {
          echo $post;</pre>
<pre>        }
     }
   }</pre>
<pre>?&gt;</pre>
<pre>&lt;form method="post" action=""&gt;
   &lt;label for="name"&gt;Type your name&lt;/label&gt;
   &lt;input type="text" name="name" /&gt;
   &lt;input type="submit" name="submit" value="Output my name" /&gt;
&lt;/form&gt;</pre>
<p>If you do a print_r of $_POST, the submit will be there, because we didn&#8217;t use a function to pull it from it&#8217;s original array,but from every key and it&#8217;s value, we check if there is something which isn&#8217;t equal to &#8220;submit&#8221;, the IF statement will get rid of it, then when we echo the temporary variable $post, we get only our name.</p>
<p>Read this post again and again, until you understand how HTML Forms and PHP Works, next time there will be more from Complex Forms. Try fiddling with the $_GET and $_POST arrays and see the effects. You can also set values in $_GET and $_POST though it&#8217;s a bit useless. They are arrays after all. <img src='http://www.geekscribes.net/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<h3 style="text-align: center;">This article was contributed by Tipa of <a title="Mu-Anime: Tipa's Site" href="http://www.mu-anime.com/" target="_blank">Mu-Anime</a></h3>
<p><div class="eg-series"><div class="eg-series-posts"><h3>PHP Lessons</h3><ul class="eg-series-posts"><li class="eg-series-posts-item "><span class="eg-series-post-title"><a href="http://www.geekscribes.net/blog/2009/08/01/php-lessons-intro-and-variables/" title="PHP Lessons Part 1: Introduction to PHP and Variables">PHP Lessons Part 1: Introduction to PHP and Variables</a></span>  - <span class="eg-series-post-date date">August 1, 2009</span></li><li class="eg-series-posts-item "><span class="eg-series-post-title"><a href="http://www.geekscribes.net/blog/2009/08/01/php-lessons-operators/" title="PHP Lessons Part 2: Operators">PHP Lessons Part 2: Operators</a></span>  - <span class="eg-series-post-date date">August 1, 2009</span></li><li class="eg-series-posts-item "><span class="eg-series-post-title"><a href="http://www.geekscribes.net/blog/2009/08/08/php-lessons-conditional-statements/" title="PHP Lessons Part 3: Conditional Statements">PHP Lessons Part 3: Conditional Statements</a></span>  - <span class="eg-series-post-date date">August 8, 2009</span></li><li class="eg-series-posts-item "><span class="eg-series-post-title"><a href="http://www.geekscribes.net/blog/2009/08/11/php-lessons-arrays/" title="PHP Lessons Part 4: Arrays">PHP Lessons Part 4: Arrays</a></span>  - <span class="eg-series-post-date date">August 11, 2009</span></li><li class="eg-series-posts-item "><span class="eg-series-post-title"><a href="http://www.geekscribes.net/blog/2009/08/14/php-lessons-loops/" title="PHP Lessons 5: Loops">PHP Lessons 5: Loops</a></span>  - <span class="eg-series-post-date date">August 14, 2009</span></li><li class="eg-series-posts-item "><span class="eg-series-post-title"><a href="http://www.geekscribes.net/blog/2009/08/15/php-lessons-break-continue/" title="PHP Lessons 6: Break and Continue">PHP Lessons 6: Break and Continue</a></span>  - <span class="eg-series-post-date date">August 15, 2009</span></li><li class="eg-series-posts-item "><span class="eg-series-post-title"><a href="http://www.geekscribes.net/blog/2009/08/17/php-lesson-functions/" title="PHP Lessons 7: Functions in PHP">PHP Lessons 7: Functions in PHP</a></span>  - <span class="eg-series-post-date date">August 17, 2009</span></li><li class="eg-series-posts-item current"><span class="eg-series-post-title">PHP Lessons 8: Server Constants and HTML Forms</span> <span class="eg-series-post-this">(This post)</span> - <span class="eg-series-post-date date">December 10, 2009</span></li><li class="eg-series-posts-item "><span class="eg-series-post-title"><a href="http://www.geekscribes.net/blog/2010/03/19/php-lessons-9-session-and-cookies/" title="PHP Lessons 9: Session and Cookies">PHP Lessons 9: Session and Cookies</a></span>  - <span class="eg-series-post-date date">March 19, 2010</span></li></ul></div></div><br />
<h3>You might also be interested in:</h3>
<ul class="related_post">
<li><a href="http://www.geekscribes.net/blog/2010/03/19/php-lessons-9-session-and-cookies/" title="PHP Lessons 9: Session and Cookies">PHP Lessons 9: Session and Cookies</a></li>
<li><a href="http://www.geekscribes.net/blog/2009/08/17/php-lesson-functions/" title="PHP Lessons 7: Functions in PHP">PHP Lessons 7: Functions in PHP</a></li>
<li><a href="http://www.geekscribes.net/blog/2009/08/15/php-lessons-break-continue/" title="PHP Lessons 6: Break and Continue">PHP Lessons 6: Break and Continue</a></li>
<li><a href="http://www.geekscribes.net/blog/2009/08/14/php-lessons-loops/" title="PHP Lessons 5: Loops">PHP Lessons 5: Loops</a></li>
<li><a href="http://www.geekscribes.net/blog/2009/08/11/php-lessons-arrays/" title="PHP Lessons Part 4: Arrays">PHP Lessons Part 4: Arrays</a></li>
</ul>
<p>This article comes from <a href="http://www.geekscribes.net/blog">GeekScribes</a><br/><br/><a href="http://www.geekscribes.net/blog/2009/12/10/php-lessons-8-server-constants-and-html-forms/">PHP Lessons 8: Server Constants and HTML Forms</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/4_ELnadbKQnngnG90E9Pbq1hlS0/0/da"><img src="http://feedads.g.doubleclick.net/~a/4_ELnadbKQnngnG90E9Pbq1hlS0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/4_ELnadbKQnngnG90E9Pbq1hlS0/1/da"><img src="http://feedads.g.doubleclick.net/~a/4_ELnadbKQnngnG90E9Pbq1hlS0/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Geekscribes?a=m-7yeycCEFo:VpX_6vb6RbA:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Geekscribes?i=m-7yeycCEFo:VpX_6vb6RbA:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=m-7yeycCEFo:VpX_6vb6RbA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Geekscribes?i=m-7yeycCEFo:VpX_6vb6RbA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=m-7yeycCEFo:VpX_6vb6RbA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Geekscribes?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=m-7yeycCEFo:VpX_6vb6RbA:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Geekscribes?i=m-7yeycCEFo:VpX_6vb6RbA:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=m-7yeycCEFo:VpX_6vb6RbA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Geekscribes?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Geekscribes/~4/m-7yeycCEFo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.geekscribes.net/blog/2009/12/10/php-lessons-8-server-constants-and-html-forms/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.geekscribes.net/blog/2009/12/10/php-lessons-8-server-constants-and-html-forms/</feedburner:origLink></item>
		<item>
		<title>3 Features Mobile Phones Should Have But Most Don’t</title>
		<link>http://feedproxy.google.com/~r/Geekscribes/~3/Ab-gPZWdGzs/</link>
		<comments>http://www.geekscribes.net/blog/2009/11/02/3-features-mobile-phones-should-have/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 14:59:40 +0000</pubDate>
		<dc:creator>InF</dc:creator>
				<category><![CDATA[Mobile Phones]]></category>
		<category><![CDATA[Tech Posts]]></category>
		<category><![CDATA[Features]]></category>
		<category><![CDATA[Mobiles]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.geekscribes.net/blog/?p=740</guid>
		<description><![CDATA[I don&#8217;t consider myself to be a very heavy mobile user. Apart from the usual SMS and receiving calls, I sometimes use the camera, or the included Wifi-capability of my phone to browse a bit around while on the go. However, there is a set of features which I sorely miss in my device, and [...]<p>This article comes from <a href="http://www.geekscribes.net/blog">GeekScribes</a><br/><br/><a href="http://www.geekscribes.net/blog/2009/11/02/3-features-mobile-phones-should-have/">3 Features Mobile Phones Should Have But Most Don&#8217;t</a></p>
]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t consider myself to be a very heavy mobile user. Apart from the usual SMS and receiving calls, I sometimes use the camera, or the included Wifi-capability of my phone to browse a bit around while on the go. However, there is a set of features which I sorely miss in my device, and other devices I&#8217;ve used. I&#8217;ve compiled a list here, and I can only hope some developer stumbles on this page, and decides to implement those. Despite not being critical, they would go a long way in making a device much more usable. They are not too difficult to implement I think, so here goes nothing&#8230;</p>
<p><strong>Timed Profiles</strong></p>
<p>I think it must be Nokia that came up with this bright idea years ago. Indeed, it&#8217;s a very good feature (at least it is for me). I don&#8217;t have to remember to set my device to Silent before going to lectures and such. But since it was implemented, the feature has hardly evolved.</p>
<p>Also, accessing this feature is a pain in itself. In Nokia devices, you have to dig through the menus down to Profiles, and there you get the option to activate it.</p>
<p>The only thing you can do is set a profile, then time another to expire at a time. After that, the other profile will activate, and when the time is up, the previous profile will be activated automatically. Easy to understand but not very useful.</p>
<p>What would have been useful is able to repeat the expiry time or even plan the expiry of profiles over the week. Say, General profile will be active from 18h to 23h, Sleep profile will activate from 23h to 07h. And Silent active from 07h to 18h. And that schedule will be applicable only during weekdays, while during weekends, you have another set of times.</p>
<p>But no, for now, you can&#8217;t have it in-built. Yet.<br />
<strong> </strong></p>
<p><strong>Delay SMS Sending</strong></p>
<p>Another feature I sorely miss. It&#8217;s not even available on the networks as a service most of the time! Oh, I do agree there are ways to do without, like setting a reminder and have it sent at a particular date and time. This was possible in my old handset, but not now. It&#8217;s as if handsets are de-evolving! Now, on my N85, I don&#8217;t even have a stopwatch, while the good old 3310 had one!</p>
<p>Anyway, back to the point. What I want is a way to compose a message and save it. Then set it to be sent at a date and time. Sometimes, you need to remind a friend to bring you something, but only on the eve of the day you meet. You have to remember to send that message yourself, even if your device could have done the remembering with more ease.</p>
<p>Again no, it doesn&#8217;t exist yet as an in-built facility. Not in any device I know of. It may exist as an addon-application, but it needs to be in-built!<br />
<strong> </strong></p>
<p><strong>LED to indicate new stuff E.g. Missed Calls or SMS pending</strong></p>
<p>My good old Sony Ericsson had a LED outside that flashed. But the problem is that it flashed just to indicate that the phone was on. Kind of a waste if you ask me. It could have been put to much better use as BlackBerry did.</p>
<p>BlackBerry devices have a small LED light that flashes when you have pending sms, calls or emails. Why don&#8217;t all devices have that? Even the high-end ones don&#8217;t!</p>
<p>Better yet would have the LED flash different colors for different things missing, maybe in order of priority. SMS pending flashes blue. Missed calls flashes red. But if you had both, the light would still flash red. At least you&#8217;d know from afar if you had something waiting, without having to touch the phone, or press a key to know.</p>
<p>If this is not possible, just make the LED flash at different speeds for different things.</p>
<p>But no, for now, I have to content myself with a dumb LED that tells me my phone is on. Very useful indeed!</p>
<p><strong>All those small, but useful applications that were in older devices</strong></p>
<p>Stopwatch? Timer? Alarm? Flashlight? Please, I bought a device that was multiples of the price of those lower-end phones, but still, it didn&#8217;t have all the features of those phones in them. I don&#8217;t have a stopwatch! I really need a stopwatch sometimes, and I don&#8217;t have one. Not in a device that costs nearly $300! What the hell! A device that costs $100 has it!</p>
<p>That is not fair developers! Give us those features back. We deserve them. And most of them are mostly software, so you can&#8217;t complain that it&#8217;ll take space inside the device as hardware.</p>
<p>There you go. I have completed my list of 3 features I really miss on any handset I&#8217;ve used, and really wished they were there. Do you have a feature that you wished was there, but is not? Let us know. <img src='http://www.geekscribes.net/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
<h3>You might also be interested in:</h3>
<ul class="related_post">
<li><a href="http://www.geekscribes.net/blog/2009/09/27/clean-up-font-clutter-with-font-frenzy/" title="Clean Up Font Clutter with Font Frenzy">Clean Up Font Clutter with Font Frenzy</a></li>
<li><a href="http://www.geekscribes.net/blog/2009/06/19/internet-explorer-lolz-act-2/" title="Internet Explorer 8 Lolz: Act 2">Internet Explorer 8 Lolz: Act 2</a></li>
<li><a href="http://www.geekscribes.net/blog/2009/06/01/in-search-of-the-ultimate-desktop-rss-reader/" title="In search of the ultimate desktop RSS reader">In search of the ultimate desktop RSS reader</a></li>
<li><a href="http://www.geekscribes.net/blog/2009/01/10/looking-for-a-mobile-opinions/" title="Looking for a mobile: My opinions">Looking for a mobile: My opinions</a></li>
<li><a href="http://www.geekscribes.net/blog/2008/10/27/china-channel-firefox-addon-experience-internet-censorship/" title="China Channel Firefox Addon: Experience Internet Censorship">China Channel Firefox Addon: Experience Internet Censorship</a></li>
</ul>
<p>This article comes from <a href="http://www.geekscribes.net/blog">GeekScribes</a><br/><br/><a href="http://www.geekscribes.net/blog/2009/11/02/3-features-mobile-phones-should-have/">3 Features Mobile Phones Should Have But Most Don&#8217;t</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/wZeKdnAwpS7AVXpCZ0xh1tK5pGo/0/da"><img src="http://feedads.g.doubleclick.net/~a/wZeKdnAwpS7AVXpCZ0xh1tK5pGo/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/wZeKdnAwpS7AVXpCZ0xh1tK5pGo/1/da"><img src="http://feedads.g.doubleclick.net/~a/wZeKdnAwpS7AVXpCZ0xh1tK5pGo/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Geekscribes?a=Ab-gPZWdGzs:yPvmPvI14BA:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Geekscribes?i=Ab-gPZWdGzs:yPvmPvI14BA:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=Ab-gPZWdGzs:yPvmPvI14BA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Geekscribes?i=Ab-gPZWdGzs:yPvmPvI14BA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=Ab-gPZWdGzs:yPvmPvI14BA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Geekscribes?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=Ab-gPZWdGzs:yPvmPvI14BA:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Geekscribes?i=Ab-gPZWdGzs:yPvmPvI14BA:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=Ab-gPZWdGzs:yPvmPvI14BA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Geekscribes?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Geekscribes/~4/Ab-gPZWdGzs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.geekscribes.net/blog/2009/11/02/3-features-mobile-phones-should-have/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.geekscribes.net/blog/2009/11/02/3-features-mobile-phones-should-have/</feedburner:origLink></item>
		<item>
		<title>Clean Up Font Clutter with Font Frenzy</title>
		<link>http://feedproxy.google.com/~r/Geekscribes/~3/2a6JACr41r4/</link>
		<comments>http://www.geekscribes.net/blog/2009/09/27/clean-up-font-clutter-with-font-frenzy/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 16:02:55 +0000</pubDate>
		<dc:creator>InF</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Tech Posts]]></category>
		<category><![CDATA[Cleanup]]></category>
		<category><![CDATA[Font Frenzy]]></category>
		<category><![CDATA[Fonts]]></category>
		<category><![CDATA[Freeware]]></category>
		<category><![CDATA[Unclutter]]></category>
		<category><![CDATA[Utilities]]></category>

		<guid isPermaLink="false">http://www.geekscribes.net/blog/?p=722</guid>
		<description><![CDATA[I&#8217;m the kind of dude that install fonts by the buckets. I like fonts, and I like variety in my creations. Also, some programs that I install tend to place their own fonts on my machine on their own. After a while, this creates a huge mess and your fonts list in your applications grows [...]<p>This article comes from <a href="http://www.geekscribes.net/blog">GeekScribes</a><br/><br/><a href="http://www.geekscribes.net/blog/2009/09/27/clean-up-font-clutter-with-font-frenzy/">Clean Up Font Clutter with Font Frenzy</a></p>
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m the kind of dude that install fonts by the buckets. I like fonts, and I like variety in my creations. Also, some programs that I install tend to place their own fonts on my machine on their own. After a while, this creates a huge mess and your fonts list in your applications grows excessively long. If ever the applications you use have font preview, this makes the matters worse! I&#8217;ve had Wordpad and some other programs crashing on me due to some corrupt font, or some font they didn&#8217;t like while I was browsing the font list.</p>
<p>Also, apparently, having a ton of fonts installed can bring down the performance of your machine, so before installing that font pack with a zillion fancy fonts in it, you might re-consider. Though I have to say, I never noticed the performance hit myself, despite the 1067 fonts I had installed.</p>
<p>Thus, there comes a time in the life of every font freak, where they must clean up their fonts folder. The problem is that Windows has a set of fonts that it likes and cannot work without. I&#8217;ll call these system-critical fonts. If you delete those, you will have a brick of a machine on your hands, and a re-install of the OS could save it, but lot of pains involved. Thus you would want a way to clean up that font folder of yours while keeping the essential fonts, correct?</p>
<p>Here comes <a title="Font Frenzy's Homepage" href="http://www.sdsoftware.org/default.asp?id=5929" target="_blank">Font Frenzy</a>! Font Frenzy is a free software that will allow you to preview what fonts you have installed, but also manage them. By manage, I mean, install new fonts, back up existing fonts and uninstall those you don&#8217;t want. All this in a very simple interface.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-723" title="FontFrenzy" src="http://www.geekscribes.net/blog/wp-content/uploads/2009/09/FontFrenzy.jpg" alt="FontFrenzy" width="451" height="448" /></p>
<p>But the most interesting feature of Font Frenzy, something that I have not seen in other font managers, is the ability to &#8220;DeFrenzy&#8221; your font folder. What this does is uninstall all those non system-critical fonts that you have installed. Before doing that, it&#8217;ll prompt you to create a snapshot of your current fonts. I&#8217;ll explain what this does later. After that, it&#8217;ll &#8220;uninstall&#8221; all those unnecessary fonts by removing them from the OS&#8217; font folder, and place them somewhere of your own liking. Thus, you have a backup of the fonts, but at the same time, they do not clutter. You can then pick and choose which ones to re-install at a later time.</p>
<p>Now about those snapshots. They are in fact saved states of your font folders. Using snapshots, you can easily add or remove sets of fonts. For example, I have a snapshot where I have &#8220;DeFrenzied&#8221; my whole font folder, returning my system to its default state. Then, when I need all my fonts back, I just &#8220;ReFrenzy&#8221; using that snapshot, and get all my fonts back. Likewise, you can have different snapshots for different installed font-sets. E.g. A set with only default+graffiti fonts for example.</p>
<p>Oh, if you still want to clean up the your font mess manually, <a title="About.com - Essential Windows Fonts" href="http://graphicssoft.about.com/od/aboutgraphics/a/fontoverload_3.htm" target="_blank">this list</a> should be helpful to know what NOT to delete.</p>
<p>Summarizing, the good points of Font Frenzy are:</p>
<ul>
<li>Simple interface</li>
<li><strong>Ability to remove non-essential or non-default fonts from a system automatically</strong></li>
<li>Can restore all removed fonts via snapshots</li>
<li>Can manage fonts (install, delete)</li>
<li>Can backup fonts to a folder you like (Unload and Store) in FrenzyMan</li>
</ul>
<p>The cons are:</p>
<ul>
<li>ReFrenzy, DeFrenzy, FrenzyMan&#8230; these terms can be confusing to the new user, but you get used to them after a while.</li>
<li>DeFrenzy (remove all non-essential fonts) does not remove all non-essentials apparently. It does leave some fonts behind. I don&#8217;t know if they can be considered essential, but nevertheless, Font Frenzy does a decent job at cleaning up things.</li>
<li>If you check the Fonts folder in Windows, you will see that not all the removed fonts are gone from that folder. I think Font Frenzy just removes some entries from the registry for some fonts, so they look as if they are un-installed.</li>
</ul>
<p>So I&#8217;d say, if you need a simple, but good font manager, give Font Frenzy a try.<br />
<h3>You might also be interested in:</h3>
<ul class="related_post">
<li><a href="http://www.geekscribes.net/blog/2009/06/01/in-search-of-the-ultimate-desktop-rss-reader/" title="In search of the ultimate desktop RSS reader">In search of the ultimate desktop RSS reader</a></li>
<li><a href="http://www.geekscribes.net/blog/2008/04/08/transparent-windows-with-xneat/" title="Transparent Windows with XNeat!">Transparent Windows with XNeat!</a></li>
<li><a href="http://www.geekscribes.net/blog/2009/11/02/3-features-mobile-phones-should-have/" title="3 Features Mobile Phones Should Have But Most Don&#8217;t">3 Features Mobile Phones Should Have But Most Don&#8217;t</a></li>
<li><a href="http://www.geekscribes.net/blog/2009/06/19/internet-explorer-lolz-act-2/" title="Internet Explorer 8 Lolz: Act 2">Internet Explorer 8 Lolz: Act 2</a></li>
<li><a href="http://www.geekscribes.net/blog/2008/10/27/china-channel-firefox-addon-experience-internet-censorship/" title="China Channel Firefox Addon: Experience Internet Censorship">China Channel Firefox Addon: Experience Internet Censorship</a></li>
</ul>
<p>This article comes from <a href="http://www.geekscribes.net/blog">GeekScribes</a><br/><br/><a href="http://www.geekscribes.net/blog/2009/09/27/clean-up-font-clutter-with-font-frenzy/">Clean Up Font Clutter with Font Frenzy</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/a8k0rFuEzXzbzFCiCdXIYCCIiZ8/0/da"><img src="http://feedads.g.doubleclick.net/~a/a8k0rFuEzXzbzFCiCdXIYCCIiZ8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/a8k0rFuEzXzbzFCiCdXIYCCIiZ8/1/da"><img src="http://feedads.g.doubleclick.net/~a/a8k0rFuEzXzbzFCiCdXIYCCIiZ8/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Geekscribes?a=2a6JACr41r4:H9lJvvh2xW8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Geekscribes?i=2a6JACr41r4:H9lJvvh2xW8:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=2a6JACr41r4:H9lJvvh2xW8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Geekscribes?i=2a6JACr41r4:H9lJvvh2xW8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=2a6JACr41r4:H9lJvvh2xW8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Geekscribes?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=2a6JACr41r4:H9lJvvh2xW8:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Geekscribes?i=2a6JACr41r4:H9lJvvh2xW8:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=2a6JACr41r4:H9lJvvh2xW8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Geekscribes?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Geekscribes/~4/2a6JACr41r4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.geekscribes.net/blog/2009/09/27/clean-up-font-clutter-with-font-frenzy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.geekscribes.net/blog/2009/09/27/clean-up-font-clutter-with-font-frenzy/</feedburner:origLink></item>
		<item>
		<title>Phased Upgrade of Windows Live Messenger 8.x</title>
		<link>http://feedproxy.google.com/~r/Geekscribes/~3/RY9NsE7pFz8/</link>
		<comments>http://www.geekscribes.net/blog/2009/09/16/phased-upgrade-of-windows-live-messenger/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 08:51:54 +0000</pubDate>
		<dc:creator>InF</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Tech News]]></category>
		<category><![CDATA[Tech Posts]]></category>
		<category><![CDATA[Live Messenger Plus]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Windows Live Messenger]]></category>

		<guid isPermaLink="false">http://www.geekscribes.net/blog/?p=716</guid>
		<description><![CDATA[Hello folks, been a while, ain&#8217;t it?
This post will be about Windows Live Messenger &#8211; WLM. Call me oldstyle, but I liked the lightness of WLM 8.1. Hadn&#8217;t even bothered moving to 8.5.
What do I see today? I cannot connect to WLM because of a forced phased phorsed upgrade instruction from Microsoft to correct a [...]<p>This article comes from <a href="http://www.geekscribes.net/blog">GeekScribes</a><br/><br/><a href="http://www.geekscribes.net/blog/2009/09/16/phased-upgrade-of-windows-live-messenger/">Phased Upgrade of Windows Live Messenger 8.x</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Hello folks, been a while, ain&#8217;t it?</p>
<p>This post will be about Windows Live Messenger &#8211; WLM. Call me oldstyle, but I liked the lightness of WLM 8.1. Hadn&#8217;t even bothered moving to 8.5.</p>
<p>What do I see today? I cannot connect to WLM because of a <span style="text-decoration: line-through;">forced</span> <span style="text-decoration: line-through;">phased</span> phorsed upgrade instruction from Microsoft to correct a <a title="Microsoft - WLM ActiveX Security Flaw" href="http://www.microsoft.com/technet/security/advisory/973882.mspx" target="_blank">security flaw</a> that had cropped up. Now, I&#8217;ve finally decided to upgrade to WLM 2009 and I&#8217;ll give you my first impressions.</p>
<p>I think Microsoft has gone haywire. I want to download WLM and what I get is a bloated package of 135MB something with tons of apps that I don&#8217;t want. What the hell is that strategy? I refused to comply and searched for a Standalone Installer. <a title="Softpedia - WLM 2009 build 8089" href="http://www.softpedia.com/get/Internet/Chat/Instant-Messaging/Windows-Live-Messenger-9.shtml" target="_blank">Softpedia</a> came to the rescue. The installer there is just WLM in a 24MB package. Much better.</p>
<p><strong>Update: </strong>Note you may also need to install other files to get the standalone working, most notably contacts.msi to solve a 80x error message. These, and some info, are available at this <a title="MyDigitalLife - Standalone Installers" href="http://www.mydigitallife.info/2009/08/20/windows-live-essentials-wave-3-qfe-2-standalone-messenger-and-other-apps-installers-download/" target="_blank">MyDigitalLife</a> post.</p>
<p>The installation goes smoothly. Nothing to complain here.</p>
<p>There are some issues with the new WLM 2009 which I don&#8217;t particularly like:</p>
<ul>
<li>It&#8217;s bloated! 8.1 used to take 15MBish of RAM. 2009 takes 36MB! It&#8217;s not terribly bad, but I still like my applications slim.</li>
<li>The interface is weird. I&#8217;ve been taught that the eye reads from left to right. What the display pictures are doing in the left instead of the right is beyond my understanding. I&#8217;d think that the chat text is more important than the display pictures. That&#8217;s not what MS thinks apparently. Good thing is, you can hide the display pics like before.</li>
<li>Whenever I open any menu, there&#8217;s a lag where my PC freezes for a bit. I don&#8217;t know if it&#8217;s just me, or for everyone else too.</li>
</ul>
<p>The good points are:</p>
<ul>
<li>Probably more secured.</li>
<li>More customizable, specially for the layout and contact list. E.g. The size of the display pictures can be changed in the list.</li>
<li>Reworked color schemes. The color frames around the display pictures indicating status is a good idea.</li>
<li>Generally more organized and pleasing to the eye.</li>
<li>The interface, despite some weird points, is better. Moving the emoticons and other icons down the conversation box and removal of the send button, etc&#8230; saves space.</li>
<li>You can now display &#8220;What you are listening&#8221; and your &#8220;personal message&#8221; at the same time.</li>
<li>You can sign in from multiple computers at the same time, and sign off them remotely.</li>
</ul>
<p>Most things are already updated to work with WLM 2009, like for those of you who use <a title="MessengerPlus Homepage" href="http://www.msgplus.net/" target="_blank">MessengerPlus</a>, it&#8217;s already up to date.</p>
<p>That&#8217;s about it. I&#8217;m not terribly satisfied with the WLM 2009. I liked the 8.1 interface best, but I am forced to use 2009. Let&#8217;s hope it&#8217;s as good as 8.1.</p>
<p>Your views on this, if you use WLM?<br />
<h3>You might also be interested in:</h3>
<ul class="related_post">
<li><a href="http://www.geekscribes.net/blog/2008/07/27/spice-up-your-live-messenger/" title="Spice up your live messenger">Spice up your live messenger</a></li>
<li><a href="http://www.geekscribes.net/blog/2010/03/02/windows-7-cannot-sleep-solutions/" title="Windows 7: Solutions to can&#8217;t sleep problems.">Windows 7: Solutions to can&#8217;t sleep problems.</a></li>
<li><a href="http://www.geekscribes.net/blog/2009/06/19/internet-explorer-lolz-act-2/" title="Internet Explorer 8 Lolz: Act 2">Internet Explorer 8 Lolz: Act 2</a></li>
<li><a href="http://www.geekscribes.net/blog/2009/06/18/is-microsoft-that-afraid-of-firefox/" title="Is Microsoft THAT afraid of Firefox?">Is Microsoft THAT afraid of Firefox?</a></li>
<li><a href="http://www.geekscribes.net/blog/2009/03/17/keep-the-command-prompt-open-after-using-run/" title="Keep the command prompt open after using Run">Keep the command prompt open after using Run</a></li>
</ul>
<p>This article comes from <a href="http://www.geekscribes.net/blog">GeekScribes</a><br/><br/><a href="http://www.geekscribes.net/blog/2009/09/16/phased-upgrade-of-windows-live-messenger/">Phased Upgrade of Windows Live Messenger 8.x</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/Ti49joTknwLDCV7dAeVHQeK3pBw/0/da"><img src="http://feedads.g.doubleclick.net/~a/Ti49joTknwLDCV7dAeVHQeK3pBw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Ti49joTknwLDCV7dAeVHQeK3pBw/1/da"><img src="http://feedads.g.doubleclick.net/~a/Ti49joTknwLDCV7dAeVHQeK3pBw/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Geekscribes?a=RY9NsE7pFz8:Rt8_GvvZvN0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Geekscribes?i=RY9NsE7pFz8:Rt8_GvvZvN0:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=RY9NsE7pFz8:Rt8_GvvZvN0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Geekscribes?i=RY9NsE7pFz8:Rt8_GvvZvN0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=RY9NsE7pFz8:Rt8_GvvZvN0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Geekscribes?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=RY9NsE7pFz8:Rt8_GvvZvN0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Geekscribes?i=RY9NsE7pFz8:Rt8_GvvZvN0:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=RY9NsE7pFz8:Rt8_GvvZvN0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Geekscribes?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Geekscribes/~4/RY9NsE7pFz8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.geekscribes.net/blog/2009/09/16/phased-upgrade-of-windows-live-messenger/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.geekscribes.net/blog/2009/09/16/phased-upgrade-of-windows-live-messenger/</feedburner:origLink></item>
		<item>
		<title>Internet Addiction – A Serious Crisis!</title>
		<link>http://feedproxy.google.com/~r/Geekscribes/~3/swRGqDiMRik/</link>
		<comments>http://www.geekscribes.net/blog/2009/08/26/internet-addiction-a-serious-crisis/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 19:27:18 +0000</pubDate>
		<dc:creator>Viper</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Randomness]]></category>
		<category><![CDATA[Addiction]]></category>
		<category><![CDATA[Health]]></category>

		<guid isPermaLink="false">http://www.geekscribes.net/blog/?p=708</guid>
		<description><![CDATA[As wonderful as it may seem, the Internet is a fascinating tool to which everyone (well almost) has adopted a keen interest of the benefits it provides. However the more time you spend surfing on it, the more likely you are getting addicted to it. Over the last few news a new phenomenon has increasing [...]<p>This article comes from <a href="http://www.geekscribes.net/blog">GeekScribes</a><br/><br/><a href="http://www.geekscribes.net/blog/2009/08/26/internet-addiction-a-serious-crisis/">Internet Addiction &#8211; A Serious Crisis!</a></p>
]]></description>
			<content:encoded><![CDATA[<p>As wonderful as it may seem, the Internet is a fascinating tool to which everyone (well almost) has adopted a keen interest of the benefits it provides. However the more time you spend surfing on it, the more likely you are getting addicted to it. Over the last few news a new phenomenon has increasing at an alarming rate. Scientists call it the Internet Addiction Disorder (IAD) and it has been the subject of new research and debate.</p>
<p>The concern is so big that in the U.S, they have a launched an addiction recovery program to help sufferers of IAD to better manage their life in a more &#8216;harmonious&#8217; way. You might think this only concern to those who &#8216;Google&#8217; everyday. Wrong guys!! Internet-based video games falls into this category. The program known as reSTART is meticulously planned over 45 days and it has already received it&#8217;s first patient, a 19 year old who cannot deprive himself of World of Warcraft.</p>
<p>So how do you know if you are an IAD sufferer? reSTART has outlined 9 symptoms by which are qualified for admittance:</p>
<ul>Have a strong desire to use the Internet</ul>
<ul>Decreasing or withdrawal of internet leads to symptoms like malaise, relentlessness, lack of concentration and so on.</ul>
<ul>Increasing usage of Internet results into satisfaction</ul>
<ul>Difficulty to stop the usage despite you are aware it&#8217;s harmful</ul>
<ul>Unable to control the duration of time of internet use</ul>
<ul>Social, recreational and other personal interests decreases</ul>
<ul>Solace is found in using the Internet so as to flee from the outside pressures</ul>
<ul>Extent of use is denied to friends, teachers or schoolmates</ul>
<ul>Everyday routines and social functions (academic, workability) are impaired</ul>
<p>The treatment? Well basically it cuts off the web and online gaming and focuses more on social skills. The patients are constantly followed by a recreation coach, a therapist, exercise and yoga instructors and more. Besides each patient have a schedule to follow which includes physical exercises (sports and fitness), chores, vocational training, a 3 hour back to nature period, a regular life quest and of course he/she is given a personal time everyday from 8.30 PM to 10.00 PM after which the lights are out!</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/xWPAm_SVCc4&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/xWPAm_SVCc4&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Of course, such program does not come cheap!! You&#8217;ll have to pay a hefty $14,500 to get admitted. Considering what it offers it&#8217;s worth it&#8217;s price but it should be the last resort to cure yourself. In many cases Internet addiction is self corrective. It has been proven that heavy Internet users temporary endures this illness as gradually they decrease their time on the computer. The point it&#8217;s up to you guys how you use it!</p>
<p>I hope it&#8217;s not too late for you. Feel free to voice out your opinions about it!!<br />
<h3>You might also be interested in:</h3>
<ul class="related_post">
<li><a href="http://www.geekscribes.net/blog/2009/08/22/swine-flu-in-mauritius-a-tale-of-mismanagement/" title="Swine Flu in Mauritius: A Tale of Mismanagement">Swine Flu in Mauritius: A Tale of Mismanagement</a></li>
<li><a href="http://www.geekscribes.net/blog/2009/07/24/seacom-cable-goes-live/" title="Seacom goes live, connects Mauritius?">Seacom goes live, connects Mauritius?</a></li>
<li><a href="http://www.geekscribes.net/blog/2009/07/14/new-isp-in-mauritius-soon/" title="New ISP in Mauritius soon?">New ISP in Mauritius soon?</a></li>
<li><a href="http://www.geekscribes.net/blog/2008/09/24/google-turns-ten-philanthropic-project/" title="Google turns 10, Wants to help people with $10m">Google turns 10, Wants to help people with $10m</a></li>
<li><a href="http://www.geekscribes.net/blog/2008/08/08/orange-uk-sees-subscribers-leave/" title="Orange UK sees subscribers leave">Orange UK sees subscribers leave</a></li>
</ul>
<p>This article comes from <a href="http://www.geekscribes.net/blog">GeekScribes</a><br/><br/><a href="http://www.geekscribes.net/blog/2009/08/26/internet-addiction-a-serious-crisis/">Internet Addiction &#8211; A Serious Crisis!</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/-U_IKInbiJjmnmnC0SGkcOj3ZtQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/-U_IKInbiJjmnmnC0SGkcOj3ZtQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/-U_IKInbiJjmnmnC0SGkcOj3ZtQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/-U_IKInbiJjmnmnC0SGkcOj3ZtQ/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Geekscribes?a=swRGqDiMRik:D2Tg4K7PsQU:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Geekscribes?i=swRGqDiMRik:D2Tg4K7PsQU:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=swRGqDiMRik:D2Tg4K7PsQU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Geekscribes?i=swRGqDiMRik:D2Tg4K7PsQU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=swRGqDiMRik:D2Tg4K7PsQU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Geekscribes?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=swRGqDiMRik:D2Tg4K7PsQU:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Geekscribes?i=swRGqDiMRik:D2Tg4K7PsQU:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Geekscribes?a=swRGqDiMRik:D2Tg4K7PsQU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Geekscribes?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Geekscribes/~4/swRGqDiMRik" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.geekscribes.net/blog/2009/08/26/internet-addiction-a-serious-crisis/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.geekscribes.net/blog/2009/08/26/internet-addiction-a-serious-crisis/</feedburner:origLink></item>
	</channel>
</rss>
