<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Monieweb.com</title>
	<atom:link href="http://www.monieweb.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.monieweb.com</link>
	<description>So much to learn, so little time!</description>
	<lastBuildDate>Fri, 05 Mar 2010 00:58:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Writing Functions In PHP – Default Values</title>
		<link>http://www.monieweb.com/tutorials/writing-functions-in-php-default-values/</link>
		<comments>http://www.monieweb.com/tutorials/writing-functions-in-php-default-values/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 06:30:21 +0000</pubDate>
		<dc:creator>Monie</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.monieweb.com/?p=862</guid>
		<description><![CDATA[Thewebsqueeze blog post: This final tutorial in the series called “Writing Functions In PHP” explains what a default value is and what it can do. We encourage you to read the prior tutorials in this series by clicking the links in the &#8220;Related Post&#8221; section below.


We saw earlier how the numbers of arguments that were [...]


Related posts:<ol><li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-global-variable/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Global Variable'>Writing Functions In PHP &#8211; Global Variable</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-return-values/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Return Values'>Writing Functions In PHP &#8211; Return Values</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-simple-functions-php-flexibility/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Flexibility'>Writing Functions In PHP &#8211; Flexibility</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Introduction'>Writing Functions In PHP &#8211; Introduction</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p class="italic"><a href="http://www.thewebsqueeze.com/web-design-tutorials/writing-functions-in-php-default-values.html">Thewebsqueeze blog post</a>: This final tutorial in the series called “Writing Functions In PHP” explains what a default value is and what it can do. We encourage you to read the prior tutorials in this series by clicking the links in the &#8220;Related Post&#8221; section below.</p>
<p><span id="more-862"></span></p>
<h2></h2>
<p>We saw earlier how the numbers of arguments that were passed into a function needed to match the number of arguments that the function was defined with. But with default arguments, that’s not entirely true because we can set some defaults so that if it doesn’t get a value, it has something that it can assume, and this not only will make our functions more flexible but also error resistant. Let’s go ahead and try one now…</p>
<pre class="brush: php;">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Writing Functions In PHP - Default Values&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;?php

        function paint($color) {
            echo &quot;The color of the room is {$color}.&quot;;
        }

        paint(&quot;blue&quot;);

    ?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong>Output: the color of the room is blue.</strong></p>
<p>That is a simple straight forward example. What if we didn’t pass a value into the function?</p>
<pre class="brush: php;">
&lt;?php

    function paint($color) {
        echo &quot;The color of the room is {$color}.&quot;;
    }

    paint();

?&gt;
</pre>
<p>Sure we will get an error message.</p>
<p><strong>Output:<br />
Warning: Missing argument 1 for paint()…<br />
Notice: Undefined variable…<br />
The color of the room is .</strong></p>
<h2>Functions With Default Values</h2>
<p>In the example above, we can set a default value for $color, so that if it doesn’t get a $color, we have something to fall back on. We do that by simply putting in a normal equal assignment in the function right after the arguments.</p>
<pre class="brush: php;">
&lt;?php

    function paint($color=&quot;red&quot;) {
        echo &quot;The color of the room is {$color}.&quot;;
    }

    paint();

?&gt;
</pre>
<p>So now, “red” will be our default value if we haven’t passed any value to the function. In other words, if no value were passed into the function, use “red”! The default value is overwritten when you specify a value, otherwise the value will stay the same. Even though we didn’t ask for another argument, it went ahead and assume “red”. If instead we tell it “blue”, it goes ahead and uses “blue”.</p>
<p>So you can see how this is going to make our function a little more error resistant because it will not give us that big nasty error if we didn’t pass something in.</p>
<h2>Flexible Functions With Default Values</h2>
<p>Let’s go ahead and make this function even more flexible. Lets say we just are not going to paint the “room”, but instead we are going to paint the $room as a variable.</p>
<pre class="brush: php;">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Writing Functions In PHP - Default Values&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;?php

        function paint($room=&quot;office&quot;,$color=&quot;red&quot;) {
            echo &quot;The color of the {$room} is {$color}.&quot;;
        }

        paint(&quot;bedroom&quot;,&quot;blue&quot;);

    ?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong>Output: The color of the bedroom is blue.</strong></p>
<p>So, this function takes two arguments into it and we must pass two values into it as well. Even though we didn’t pass anything into the function, it went ahead and made the assumption with the default value that we have declared earlier. All of this will work:</p>
<pre class="brush: php;">&lt;?php paint(); ?&gt;</pre>
<p><strong>Output: The color of the office is red.</strong></p>
<pre class="brush: php;">&lt;?php paint(&quot;bedroom&quot;); ?&gt;</pre>
<p><strong>Output: The color of the bedroom is red.</strong></p>
<p>What if we say “blue” and leave out the other one which is the $room?</p>
<pre class="brush: php;">&lt;?php paint(&quot;blue&quot;); ?&gt;</pre>
<p><strong>Output: The color of the blue is red.</strong></p>
<p>It went ahead and says “The color of the blue is red.”, and why is that? This is because it’s going to still assume that the arguments are coming in the correct order. So we have to make sure that we always pass something in the right order.</p>
<h2>Required Value vs Not Required value</h2>
<p>Consider this example:</p>
<pre class="brush: php;">
&lt;?php

    function paint($room,$color=&quot;red&quot;) {
        echo &quot;The color of the {$room} is {$color}.&quot;;
    }

    paint(&quot;bedroom&quot;,&quot;blue&quot;);

?&gt;
</pre>
<p><strong>Output: The color of the bedroom is blue.</strong></p>
<p>We know this will work. $room is a required value and $color is not a required value, in this function. This means, a required value is a value that is having the highest priority for us, we want to make sure that we pass the correct value to this required value. Not like the $color value, which is not a required value, we can choose whether we want to specify the value or just let the function go ahead and assume for us.</p>
<p>If we did it the other way around and made our $color as the required value and pass in only one argument into the function:</p>
<pre class="brush: php;">
&lt;?php

    function paint($room=&quot;office&quot;,$color) {
        echo &quot;The color of the {$room} is {$color}.&quot;;
    }

    paint(&quot;bedroom&quot;);

?&gt;
</pre>
<p><strong>Output:<br />
Warning: Missing argument 2 for paint3()…<br />
Notice: Undefined variable…<br />
The color of the bedroom is.</strong></p>
<p>This function will take “bedroom” as being the $room, and it’s going to ask for the required value which is the $color. We didn’t pass any value to the function for the variable $color. This will return an error message to us.</p>
<p>So you want to always make sure that your default values occur last in line. In other words, anything that is required needs to come first in the arguments list, anything that is optional needs to come later and the order of this doesn’t matter and you can’t skip spaces in between. So you need to pass in something along the way.</p>
<h2>Conclusion</h2>
<p>Another thing that I found helpful with default arguments is that you very quickly get a sense of what kind of information you’re expecting to be passed in to your function.</p>
<pre class="brush: php;">&lt;?php function paint($color=&quot;red&quot;,$room=&quot;office&quot;) {?&gt;</pre>
<p>Clearly here, I am looking for a color, I know it is going to be “red” and I am looking for a room which I know is something like an “office”. This gives us some context for knowing what those variables actually mean in our function.</p>
<p>Now that we’ve looked into default argument values, I think we’ve explored enough of functions that we will be able to get a lot out of them once we start coding and developing.</p>
<p>Thank you and enjoy learning.</p>


<p>Related posts:<ol><li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-global-variable/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Global Variable'>Writing Functions In PHP &#8211; Global Variable</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-return-values/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Return Values'>Writing Functions In PHP &#8211; Return Values</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-simple-functions-php-flexibility/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Flexibility'>Writing Functions In PHP &#8211; Flexibility</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Introduction'>Writing Functions In PHP &#8211; Introduction</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.monieweb.com/tutorials/writing-functions-in-php-default-values/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Writing Functions In PHP &#8211; Global Variable</title>
		<link>http://www.monieweb.com/tutorials/writing-functions-in-php-global-variable/</link>
		<comments>http://www.monieweb.com/tutorials/writing-functions-in-php-global-variable/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 09:04:19 +0000</pubDate>
		<dc:creator>Monie</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.monieweb.com/?p=851</guid>
		<description><![CDATA[Thewebsqueeze blog post: In the last couple of tutorials, we’ve been looking at how to get values into a function and return back values back out of the function. We can get the same end result by using Global Variable.

Global Scope Variable vs Local Scope Variable
Take a look at the following code, and give it [...]


Related posts:<ol><li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-default-values/' rel='bookmark' title='Permanent Link: Writing Functions In PHP – Default Values'>Writing Functions In PHP – Default Values</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-return-values/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Return Values'>Writing Functions In PHP &#8211; Return Values</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-simple-functions-php-flexibility/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Flexibility'>Writing Functions In PHP &#8211; Flexibility</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Introduction'>Writing Functions In PHP &#8211; Introduction</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p class="italic"><a href="http://www.thewebsqueeze.com/web-design-tutorials/writing-functions-in-php-global-variable.html">Thewebsqueeze blog post</a>: In the last couple of tutorials, we’ve been looking at how to get values into a function and return back values back out of the function. We can get the same end result by using Global Variable.</p>
<p><span id="more-851"></span></p>
<h2>Global Scope Variable vs Local Scope Variable</h2>
<p>Take a look at the following code, and give it your best guess whether it’s going to come back with “outside” or “inside”?</p>
<pre class="brush: php;">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Writing Functions In PHP - Global Variable&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;?php

        $bar = &quot;outside&quot;; // global scope variable

        function foo() {
            $bar = &quot;inside&quot;; // local scope variable
        }

        foo();
        echo $bar . &quot;&lt;br&gt;&quot;;

    ?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong>Output: outside</strong></p>
<p>Why does it output “outside” instead of “inside”?</p>
<p>This is because the variable $bar (local scope variable) inside of the function has no relationship to the variable $bar (global scope variable) that was on the outside of the function. The variable inside of the function doesn’t know what value $bar is and has nothing to return out of the function. So it took the original value of $bar which is global scope variable that is “outside”. Let us see another example.</p>
<p>Now, take a guess whether it’s going to come back with “outside” or “inside” with this one?</p>
<pre class="brush: php;">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Writing Functions In PHP - Global Variable&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;?php

        $bar = &quot;outside&quot;; // global scope variable

        function foo2($var) {
            $var = &quot;inside&quot;; // local scope variable
            return $var;
        }

        $bar = foo2($bar);
        echo $bar . &quot;&lt;br&gt;&quot;;

    ?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong>Output: inside</strong></p>
<p>Yes, it’s going to display “inside” for this function. We’ve set the value for the variable $bar to “outside”, pass it as an argument into the function foo2(). The function received it and reset them with the value “inside”, a function’s local variable, and later on return back the value out of the function which will be assigned to the variable $bar.</p>
<p>There is another way that we can do this kind of variable declaration, that is by using Globals.<br />
Global Variable Declaration</p>
<p>Referring back to our first example,</p>
<pre class="brush: php;">
&lt;?php

    $bar = &quot;outside&quot;; // global scope variable

    function foo() {
        $bar = &quot;inside&quot;; // local scope variable
    }

    foo();
    echo $bar . &quot;&lt;br&gt;&quot;;

?&gt;
</pre>
<p>The variable $bar which is on the outside of the function is considered as a global variable. It has a global scope. It can be accessed anywhere inside the same page that we are working with. What ever happens inside the function is considered a local variable. It’s local only to the function and it doesn’t exist in the global scope. Anyway, we can change that by simply saying “Global $bar” inside of the function.</p>
<pre class="brush: php;">
&lt;?php

    $bar = &quot;outside&quot;;

    function foo() {
        global $bar; // declaring global variable
        $bar = &quot;inside&quot;; // local scope variable
    }

    foo();
    echo $bar . &quot;&lt;br&gt;&quot;;

?&gt;
</pre>
<p><strong>Output: inside</strong></p>
<p>What we are doing here is that we’ve told it to pull in that global variable $bar, go outside of the function and grab the variable for $bar, the global scope and pull that in so we can use it inside the function.</p>
<p>When the function finished execution, any changes that we’ve made to the variable $bar inside the function are going to be to that variable, no matter whether if it is a global scope variable or a local scope variable. In other words, the changes that we’ve made to the variable $bar inside the function are going to reset any other variable $bar outside of the function.</p>
<h2>Method Comparison</h2>
<p>When using global variable, you want to be careful because once you’ve declared something global, you’re effecting what happens outside of the function. So my advice is, use it with caution. You might be better off, passing in a variable into the function like we did in the second example.</p>
<p>If you are sure that you want to use your variable globally, then it is fine to declare your variable as global, but if you want to keep track on the values as they move around your script then you will declare your variable as a local variable. It’s a stylish choice that you’ll have to make. Here is the functions comparison that produces the same end result.</p>
<pre class="brush: php;">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Writing Functions In PHP - Global Variable&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;

    &lt;?php

        /* using global variable */

        $bar = &quot;outside&quot;;

        function foo() {
            global $bar; // declaring global variable
            $bar = &quot;inside&quot;; // local scope variable
        }

        foo();
        echo $bar . &quot;&lt;br&gt;&quot;;

    ?&gt;

    &lt;br&gt;

    &lt;?php

        /* using local variables, argumants and return values */

        $bar = &quot;outside&quot;; // global scope variable

        function foo2($var) {
            $var = &quot;inside&quot;; // local scope variable
            return $var;
        }

        $bar = foo2($bar);
        echo $bar . &quot;&lt;br&gt;&quot;;

    ?&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Now we are ready to look at how we can set some default values to the arguments that can pass into a function so that a function can have some reasonable default values in case the user doesn’t pass in information or an argument into the function.</p>
<p>We will do that in the next tutorial in this series which is the final topic that we will be discussing about php function.</p>


<p>Related posts:<ol><li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-default-values/' rel='bookmark' title='Permanent Link: Writing Functions In PHP – Default Values'>Writing Functions In PHP – Default Values</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-return-values/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Return Values'>Writing Functions In PHP &#8211; Return Values</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-simple-functions-php-flexibility/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Flexibility'>Writing Functions In PHP &#8211; Flexibility</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Introduction'>Writing Functions In PHP &#8211; Introduction</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.monieweb.com/tutorials/writing-functions-in-php-global-variable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing Functions In PHP &#8211; Return Values</title>
		<link>http://www.monieweb.com/tutorials/writing-functions-in-php-return-values/</link>
		<comments>http://www.monieweb.com/tutorials/writing-functions-in-php-return-values/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 07:44:14 +0000</pubDate>
		<dc:creator>Monie</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.monieweb.com/?p=771</guid>
		<description><![CDATA[Thewebsqueeze blog post: In the last two tutorial series, we&#8217;ve been looking at functions.  In this tutorial, we are going to look into a specific aspect of function, where function can return a value back out of them.

Catch Up!
(You can see part 1 here and part 2 here)
Referring back to our previous overtime() function:

&#60;html&#62;
&#60;head&#62;
&#60;title&#62;Writing [...]


Related posts:<ol><li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-default-values/' rel='bookmark' title='Permanent Link: Writing Functions In PHP – Default Values'>Writing Functions In PHP – Default Values</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-global-variable/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Global Variable'>Writing Functions In PHP &#8211; Global Variable</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-simple-functions-php-flexibility/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Flexibility'>Writing Functions In PHP &#8211; Flexibility</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Introduction'>Writing Functions In PHP &#8211; Introduction</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p class="italic"><a href="http://www.thewebsqueeze.com/web-design-tutorials/writing-functions-in-php-return-values.html">Thewebsqueeze blog post</a>: In the last two tutorial series, we&#8217;ve been looking at functions.  In this tutorial, we are going to look into a specific aspect of function, where function can return a value back out of them.</p>
<p><span id="more-771"></span></p>
<h2>Catch Up!</h2>
<p>(You can see part 1 <a href="http://www.monieweb.com/tutorials/writing-functions-in-php/">here</a> and part 2 <a href="http://www.monieweb.com/tutorials/writing-simple-functions-php-flexibility/">here</a>)</p>
<p>Referring back to our previous overtime() function:</p>
<pre class="brush: php;">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Writing Functions In PHP - Return Values&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php
    /* declaring our third function */
    function overtime($salary, $month, $day, $rate){
        $hourly_pay = ($salary / $month / $day) * $rate;
        echo $hourly_pay;
    }
    overtime(2000,24,8,1.5); /* passing four arguments into the function */
?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong>Output: 15.625</strong></p>
<h2>Function With Return Values</h2>
<p>We know that we must get the value out of the function (instead of just displaying it) in order for us to keep using it and keep working with it even if the function has finished execution. In order to do that, we need to return the value of $hourly_pay from the function and that&#8217;s just done with simply the word return, that&#8217;s the function that we are calling. We are telling the function, return this value!</p>
<p>It also is going to exit out of the function at that point when we say return. It&#8217;s a lot like break was when we were working with the loop. Let&#8217;s update our overtime() function so that it can return a value out of the function. The only thing that you should do is to replace the word &#8220;echo&#8221; with &#8220;return&#8221; and some modification in how we call the function.</p>
<pre class="brush: php;">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Writing Functions In PHP - Return Values&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php
    /* declaring our third function */
    function overtime($salary, $month, $day, $rate){
        $hourly_pay = ($salary / $month / $day) * $rate;
        return $hourly_pay;
    }
    $returned_value = overtime(2000,24,8, 1.5);
    echo $returned_value;
?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>So we called the function overtime(), we are going to return the value $hourly_pay to $returned_value and then echo back the new value.</p>
<p>Now, its a good idea whenever we are working with functions, especially functions that don&#8217;t just do display like we did with say_hello(), that you  always return a value out of them. Just get in a habit of making sure every function has a return. Maybe all it returns is true or false based on whether it works successfully, but we want to have something returned out of the end of that function just to let you know.</p>
<p>So for our say_hello() function, we should write something like this:</p>
<pre class="brush: php;">
&lt;?php
   function say_hello(){
     echo &quot;Hello World!&quot;;
     return true;
   }
   say_hello();
?&gt;
</pre>
<p>So, a quick tips for you. You could actually have several return values inside a function. You could have it like this:</p>
<pre class="brush: php;">
&lt;?php
   function multiple_return($val2, $val2){
      if this happens{
         return this value;
      }
      if that happens{
         return this value;
      }
   }
?&gt;
</pre>
<p>You could even have a function that had dozens of return value in it and a final return value at the very end of the function so that if none of the others were true, non of the others happen, than it would return something like FALSE or a DEFAULT value.</p>
<p>Of course if I am returning a value, then I also have to receive (or catch) the value at the other end. Unlike say_hello() function where I called it on it&#8217;s own,</p>
<pre class="brush: php;">
&lt;?php
   function say_hello($word){
     echo &quot;Hello {$word}!&quot;;
   }
   say_hello(&quot;Everyone&quot;);
?&gt;
</pre>
<p>I set it to the variable $returned_value so I can echo it back.</p>
<pre class="brush: php;">
&lt;?php
    $returned_value = overtime(2000,24,8, 1.5);
    echo $returned_value;
?&gt;
</pre>
<p>The next return value tips that I want to tell you about is that return one and only one value. If you need to return more than one value, there is a way to do that.</p>
<h2>Function With More Than One Return Values</h2>
<p>For this, let me explain in a new example.</p>
<pre class="brush: php;">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Writing Functions In PHP - Return Values&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php
    function add_subt($val1, $val2){
        $add = $val1 + $val2;
        $subt = $val1 - $val2;
        return $add;
    }
?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>This function will take the two values I give it, it will do both addition and subtraction, and right now it&#8217;s going to return addition. Subtraction will just get lost like nothing ever happen. So we can&#8217;t return more than once so we have to choose. But what if we want both?</p>
<p>Array is going to be our friendly solution here. Let&#8217;s see how array can help us.</p>
<pre class="brush: php;">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Writing Functions In PHP - Return Values&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php
    function add_subt($val1, $val2){
        $add = $val1 + $val2;
        $subt = $val1 - $val2;
        $result = array($add, $subt);
        return $result;
    }
    $result_array = add_subt(10,5);
    echo &quot;Add: &quot; . $result_array[0] . &quot;&lt;br&gt;&quot;;
    echo &quot;Subt: &quot; . $result_array[1] . &quot;&lt;br&gt;&quot;;
?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong>Output: Add: 15</strong><br />
<strong>Output: Subt: 5</strong></p>
<p>Let me guide you in the solution provided.</p>
<pre class="brush: php;">$result = array($add, $subt);</pre>
<p>The reason we use array is because array simply takes variables and put then into a single structure and assigns it to a single value like the above example. So when we want to echo both of the returned value, we call them like so:</p>
<pre class="brush: php;">
    $result_array = add_subt(10,5);
    echo &quot;Add: &quot; . $result_array[0] . &quot;&lt;br&gt;&quot;;
    echo &quot;Subt: &quot; . $result_array[1] . &quot;&lt;br&gt;&quot;;
</pre>
<p>The number in the bracket [0] and [1] indicates the $add and the $subt variable from the function attributes that we called earlier: array($add, $subt); So [0] for additional and [1] for subtraction.</p>
<p>So that&#8217;s the way that we can pass multiple results out of the function. So if we need to pass something more that just one value, we can do it with an array.</p>
<p>Now that we&#8217;ve talked about return values. We seen how a functions can do it&#8217;s processing and return a result back to what ever call the function. Next, we will look into <strong>Global Variable</strong>, a variable that is accessible from any method, procedure, or function and whose value can therefore be changed anywhere in the application.</p>
<p>We will look into that in the next series in <strong>Writing Functions In PHP &#8211; Global Variable</strong>.</p>


<p>Related posts:<ol><li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-default-values/' rel='bookmark' title='Permanent Link: Writing Functions In PHP – Default Values'>Writing Functions In PHP – Default Values</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-global-variable/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Global Variable'>Writing Functions In PHP &#8211; Global Variable</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-simple-functions-php-flexibility/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Flexibility'>Writing Functions In PHP &#8211; Flexibility</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Introduction'>Writing Functions In PHP &#8211; Introduction</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.monieweb.com/tutorials/writing-functions-in-php-return-values/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Tip: How To Use Your Favorite Font In Your Website?</title>
		<link>http://www.monieweb.com/tutorials/quick-tip-how-to-use-your-favorite-font-in-your-website/</link>
		<comments>http://www.monieweb.com/tutorials/quick-tip-how-to-use-your-favorite-font-in-your-website/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 04:44:18 +0000</pubDate>
		<dc:creator>Monie</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[quick tip]]></category>

		<guid isPermaLink="false">http://www.monieweb.com/?p=779</guid>
		<description><![CDATA[Let me introduce you to the best way to do your @font-face definitions, and you can start using your most favorite font type in your website!


I know the first thing that comes to your mind is:
&#8220;Will my browser support it?&#8221;
&#8220;Will anyone see my font type even if they don&#8217;t have the font installed on their [...]


Related posts:<ol><li><a href='http://www.monieweb.com/articles/upgrading-wordpress/' rel='bookmark' title='Permanent Link: Quick Tip: Upgrading Wordpress'>Quick Tip: Upgrading Wordpress</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p class="italic">Let me introduce you to the best way to do your @font-face definitions, and you can start using your most favorite font type in your website!</p>
<p><span id="more-779"></span></p>
<h2></h2>
<p>I know the first thing that comes to your mind is:</p>
<p><strong>&#8220;Will my browser support it?&#8221;<br />
&#8220;Will anyone see my font type even if they don&#8217;t have the font installed on their computer?&#8221;<br />
&#8220;What about licensing?<br />
&#8220;Do I need extra script to make this work?&#8221;</strong></p>
<p>I do believe that you should forget about all the &#8220;question&#8221; first and start to learn how this things is done and later on then you decide. This wont take much of your time so let us proceed.</p>
<p>Before we begin, just to let you know that an IE browser doesn&#8217;t support of use any .ttf or .otf font type. What IE needs is .eot. Other browsers must take a .ttf or .otf.</p>
<h2>The best possible solution for both IE and Firefox user</h2>
<pre class="brush: css;">
@font-face {
font-family: 'AniversRegular';
src: url('font/Anivers_Regular.eot');
src: local('Anivers Regular'), local('Anivers-Regular'),
    url('font/Anivers_Regular.otf') format('opentype');
}
</pre>
<p>Notice the difference in font format. We have .eot and .otf. Why do we have all this different format in this declaration?</p>
<p>Internet Explorer has its own method and they prefer to use the .eot method. They will not even response to the opentype or the truetype method, if you are using .ttf font format here. So, we have to make sure that we load the .eot font format first in order to make sure IE will not load all the other font format that will lead to bandwidth wastage.</p>
<h2>How do we make sure IE wont load the .otf or the .ttf font format?</h2>
<blockquote><p>
Here, non-IE browsers skip any .eot file and move on. IE will try to parse the second src value, but it can&#8217;t understand the local() location nor the multiple locations, so it resorts to the EOT instead.</p>
<p>Quote from <a href="http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/">Paul Irish</a></p></blockquote>
<p>IE browser does not understand all the <strong>commas</strong> and the <strong>local()</strong> declaration, so it will skip that line completely and it will only render the .eot file format (code line #3).</p>
<h2>Why do we have extra font name declaration?</h2>
<pre class="brush: css;">
src: local('Anivers Regular'), local('Anivers-Regular'),
    url('font/Anivers_Regular.otf') format('opentype');
</pre>
<p>The first local declaration &#8220;<strong>local(&#8216;Anivers Regular&#8217;)</strong>&#8221; will find the existing font type in the user local computer and load that. If it can&#8217;t find that, then it will execute the second selection which is the &#8220;<strong>local(&#8216;Anivers-Regular&#8217;)</strong>&#8220;, just in case they have a different name in the user&#8217;s PC. The last resort, it will load the font that we have included in our website.</p>
<h2>How to use it?</h2>
<pre class="brush: plain;">
h1 { font: 32px 'Anivers','AniversRegular',Georgia, sans-serif; }
</pre>
<p>The first declaration, &#8220;<strong>Anivers</strong>&#8221; is going to find if the font exist in the user&#8217;s computer. The second one &#8220;<strong>AniversRegular</strong>&#8221; will load our favorite font that we&#8217;ve declared earlier, and when everything else went wrong, the backup font type will be loaded which is &#8220;Georgia&#8221; or &#8220;sans-serif&#8221;.</p>


<p>Related posts:<ol><li><a href='http://www.monieweb.com/articles/upgrading-wordpress/' rel='bookmark' title='Permanent Link: Quick Tip: Upgrading Wordpress'>Quick Tip: Upgrading Wordpress</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.monieweb.com/tutorials/quick-tip-how-to-use-your-favorite-font-in-your-website/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Writing Functions In PHP &#8211; Flexibility</title>
		<link>http://www.monieweb.com/tutorials/writing-simple-functions-php-flexibility/</link>
		<comments>http://www.monieweb.com/tutorials/writing-simple-functions-php-flexibility/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 08:55:54 +0000</pubDate>
		<dc:creator>Monie</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.monieweb.com/?p=600</guid>
		<description><![CDATA[Thewebsqueeze blog post: This beginner tutorial explains how to write a simple php function that has flexibility.


In our last example, we created say_hello() function which is something that has the ability to take a variable or an argument passed into it ($word), and we passed a string to it. If you missed the first tutorial, [...]


Related posts:<ol><li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Introduction'>Writing Functions In PHP &#8211; Introduction</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-default-values/' rel='bookmark' title='Permanent Link: Writing Functions In PHP – Default Values'>Writing Functions In PHP – Default Values</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-global-variable/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Global Variable'>Writing Functions In PHP &#8211; Global Variable</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-return-values/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Return Values'>Writing Functions In PHP &#8211; Return Values</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p class="italic"><a href="http://www.thewebsqueeze.com/web-design-tutorials/writing-functions-in-php-flexibility.html">Thewebsqueeze blog post</a>: This beginner tutorial explains how to write a simple php function that has flexibility.</p>
<p><span id="more-600"></span></p>
<h2></h2>
<p>In our last example, we created say_hello() function which is something that has the ability to take a variable or an argument passed into it ($word), and we passed a string to it. If you missed the <a href="http://www.monieweb.com/tutorials/writing-functions-in-php/">first tutorial</a>, I recommend you read through that before starting this one.</p>
<h2>Passing A Variable Into A Function.</h2>
<p>Our previous example, we managed to pass some simple string into a function like so:</p>
<pre class="brush: php;">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Writing Functions In PHP - Flexibility&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php
    function say_hello($word){
        echo &quot;Hello {$word}!&quot;;
    }
    say_hello(&quot;Everyone&quot;); /* passing a string value into the function */
?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>It should make perfect sense to you that we can also pass a variable into a function. We do that by defining a variable and assign a value to it. Lets take our previous function for this example.</p>
<pre class="brush: php;">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Writing Functions In PHP - Flexibility&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php
    function say_hello($word){
        echo &quot;Hello {$word}!&lt;br&gt;&quot;;
    }
    say_hello(&quot;Everyone&quot;); /* passing a string value into the function */

    $name = &quot;Monie&quot;; /* declare a variable and assign a value to it */
    say_hello($name); /* passing a variable into the function */
?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>What we are doing here is that we are passing in a variable which is just a reference to the string into the function. So this will do what we&#8217;ve expected, it will reuse our say_hello() function and echo out &#8220;Hello Monie!&#8221;</p>
<h2>Flexible Function With More Arguments</h2>
<p>We&#8217;ve talked about arguments in our last tutorial, the benefit of having them is that it makes our function more flexible. We can actually make our functions even more flexible if we need to. Let me describe with an example.</p>
<pre class="brush: php;">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Writing Functions In PHP - Flexibility&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php
    /* declaring our first function */
    function say_hello($word){
        echo &quot;Hello {$word}!&lt;br&gt;&quot;;
    }
    say_hello(&quot;Everyone&quot;); /* passing a string value into the function */

    $name = &quot;Monie&quot;; /* declare a variable and assign a value to it */
    say_hello($name); /* passing a variable into the function */

    /* declaring our second function */
    function say_hello2($greeting, $person, $punct){
        echo $greeting .&quot;, &quot;. $person . $punct . &quot;&lt;br&gt;&quot;;
    }
    say_hello2(&quot;Greetings&quot;, $name, &quot;!&quot;); /* calling out the function */
?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong>Output:<br />
Hello Everyone!<br />
Hello Monie!<br />
Greetings, Monie!<br />
</strong></p>
<p>As you can see, we have three different arguments defined to the function, &#8220;$greeting&#8221;, &#8220;$person&#8221; and &#8220;$punct&#8221;. When we call the function, we actually need to give three argument pass to the function as well. This is the most important feature of a function. We always need to call them with the exact same number of argument that we&#8217;ve defined them with. Any less than that will return you an error.</p>
<p>So we&#8217;ve made our function even more flexible by using more arguments. It&#8217;s up to you to determine what needs to be flexible and what doesn&#8217;t. After all, having all this complex customized function isn&#8217;t necessarily a good thing to you. That might be a real pain for you. It might be a lot better to let your function do some of the work and know how to make an assumption. It is what we called an <strong>Error Resistant Function</strong>. Sure, it would be a more complex flexible function and fortunately I will teach you how later on in this tutorial series.</p>
<h2>Function With Returning Values</h2>
<p>Most of the time, we will need this kind of function when we need to get a value or a result out of a function so that we can keep using it and keep working with it other that just displaying them with an echo statement. Consider this example:</p>
<p>We are trying to count how much money does a person get for his overtime work. Each month, a person may or may not be working overtime. That&#8217;s why the total hours of overtime is set to a variable and not included in the function. The calculation will be done outside of the function or perhaps being sent to another function as an arguments or variable. That means, we need to get the value out of the function, which is the value of the person&#8217;s hourly paid salary, and them multiply it (another function) with the total number of overtime hour the person have taken.</p>
<p><strong>Salary:</strong> $2000<br />
<strong>Days of work in a month:</strong> 24 days<br />
<strong>Total hours of working in a day:</strong> 8 hours<br />
<strong>Total hours of overtime:</strong> Variable<br />
<strong>Overtime rate:</strong> 1.5</p>
<p>To get yourself clear with our example in calculating the person&#8217;s overtime, here is the formula that I&#8217;ll be using.</p>
<p><strong>(($salary / $month / $day) x $rate) x Total hours of overtime</strong></p>
<pre class="brush: php;">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Writing Functions In PHP - Flexibility&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php
    /* declaring our third function */
    function overtime($salary, $month, $day, $rate){
        $hourly_pay = ($salary / $month / $day) * $rate;
        echo $hourly_pay;
    }
    overtime(2000,24,8,1.5); /* passing four arguments into the function */
?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>In the above function, there is now way for us to manipulate the value from inside the function and then use it outside of the function. It&#8217;s just displays the $hourly_pay value to us but we need to multiply it with the total hours of overtime to get the exact figure of what we are trying to archive here.</p>
<p>So how can we return or send the value out of the function so that we can use them once the function has finished execution? Join me on the next issue to learn more about function with it&#8217;s capabilities to return a values.<!--more--></p>


<p>Related posts:<ol><li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Introduction'>Writing Functions In PHP &#8211; Introduction</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-default-values/' rel='bookmark' title='Permanent Link: Writing Functions In PHP – Default Values'>Writing Functions In PHP – Default Values</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-global-variable/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Global Variable'>Writing Functions In PHP &#8211; Global Variable</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-return-values/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Return Values'>Writing Functions In PHP &#8211; Return Values</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.monieweb.com/tutorials/writing-simple-functions-php-flexibility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Tip: Upgrading Wordpress</title>
		<link>http://www.monieweb.com/articles/upgrading-wordpress/</link>
		<comments>http://www.monieweb.com/articles/upgrading-wordpress/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 06:05:48 +0000</pubDate>
		<dc:creator>Monie</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[quick tip]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.monieweb.com/?p=749</guid>
		<description><![CDATA[Ever wonder the easiest way to upgrade your Wordpress? Here is the detail step that you should know. The original tutorial can be found in Wordpress.org

Overview of the Upgrade Process

Step 1: Back up your database
Step 2: Back up ALL your WordPress files
Step 3: Verify the backups
Step 4: Deactivate ALL your Plugins
Step 5: Ensure first four [...]


Related posts:<ol><li><a href='http://www.monieweb.com/tutorials/quick-tip-how-to-use-your-favorite-font-in-your-website/' rel='bookmark' title='Permanent Link: Quick Tip: How To Use Your Favorite Font In Your Website?'>Quick Tip: How To Use Your Favorite Font In Your Website?</a></li>
<li><a href='http://www.monieweb.com/articles/10-useful-links-for-wordpress-designers-and-developers/' rel='bookmark' title='Permanent Link: 10 Useful Links For Wordpress Designers and Developers'>10 Useful Links For Wordpress Designers and Developers</a></li>
<li><a href='http://www.monieweb.com/tutorials/howto-install-wordpress/' rel='bookmark' title='Permanent Link: Install WordPress locally in Windows XP – (with WampServer)'>Install WordPress locally in Windows XP – (with WampServer)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p class="italic">Ever wonder the easiest way to upgrade your Wordpress? Here is the detail step that you should know. The original tutorial can be found in <a href="http://codex.wordpress.org/Upgrading_WordPress_Extended">Wordpress.org</a></p>
<p><span id="more-749"></span></p>
<h2>Overview of the Upgrade Process</h2>
<ul>
<li>Step 1: Back up your database</li>
<li>Step 2: Back up ALL your WordPress files</li>
<li>Step 3: Verify the backups</li>
<li>Step 4: Deactivate ALL your Plugins</li>
<li>Step 5: Ensure first four steps are completed</li>
<li>Step 6: Download and extract the WordPress package</li>
<li>Step 7: Delete the old WordPress files</li>
<li>Step 8: Upload the new files</li>
<li>Step 9: Run the WordPress upgrade program</li>
<li>Step 10: Update Permalinks and .htaccess</li>
<li>Step 11: Install updated Plugins and Themes</li>
<li>Step 12: Reactivate Plugins</li>
<li>Step 13: Add security key definitions to the wp-config.php file</li>
<li>Step 14: Review what has changed in WordPress</li>
</ul>
<h2>Detailed Instructions</h2>
<h3>Step 1: Back up your database</h3>
<p>Perform a backup of your database. All of your WordPress data, such as Users, Posts, Pages, Links, and Categories, are stored in your MySQL database. Please read <a href="http://codex.wordpress.org/Backing_Up_Your_Database">Backing Up Your Database</a> for a detailed explanation of this process.</p>
<p>It is extremely important to back up your database before beginning the upgrade. If, for some reason, you find it necessary to revert back to the &#8216;old&#8217; version of WordPress, you may have to restore your database from these backups.</p>
<h3>Step 2: Back up ALL your WordPress files</h3>
<p>Back up ALL of your files in your WordPress directory and your .htaccess file. Typically, this process involves using an FTP program to download ALL your WordPress files from your host to your local computer. Please read <a href="http://codex.wordpress.org/WordPress_Backups#Backing_Up_Your_WordPress_Site">Backing Up Your WordPress</a> Site for further explanation.</p>
<p>If you have made changes to any core WordPress files, or if you&#8217;ve got customized Plugins or Themes, you will want to have a good backup of those files. It is extremely important to back up your files before beginning the upgrade. If for some reason you find it necessary to revert back to the &#8216;old&#8217; version of WordPress you will need to upload these files.</p>
<h3>Step 3: Verify the backups</h3>
<p>Verify that the backups you created are there and usable. <strong>This is the most important step in the upgrade process!</strong> The verification process involves making sure you can see the backup files on your local computer (or wherever you&#8217;ve stored them) and that you can navigate into any sub-folders. If the files are in a zip file, make sure you can open the zip file. Also consider opening a .sql file in an editor to see if the tables and data are represented.</p>
<h3>Step 4: Deactivate ALL your Plugins</h3>
<p>In your Administration panel, under the Plugins choice, deactivate any Plugins. Because of the changes to WordPress, some Plugins may conflict with the upgrade process.</p>
<h3>Step 5: Ensure first four steps are completed</h3>
<p>If you have not completed the first four procedures, STOP, and do them! Do not attempt the upgrade unless you have completed the first four steps.</p>
<h3>Step 6: Download and extract the WordPress package</h3>
<p>Download and unzip the WordPress package from <a href="http://wordpress.org/download/">http://wordpress.org/download/</a>.</p>
<ul>
<li>If you will be uploading WordPress to a remote web server, download the WordPress package to your computer with your favorite web browser and unzip the package.</li>
<li>If you have shell access to your web server, and are comfortable using console-based tools, you may wish to download WordPress directly to your web server. You can do so using wget , lynx or another console-based web browser, which are valuable if you want to avoid FTPing. Place the package in a directory parallel to your current wordpress directory (like &#8220;uploads,&#8221; for example). Then, unzip it using: gunzip -c wordpress-2.8.6.tar.gz | tar -xf &#8211; or by using: tar -xzvf latest.tar.gz</li>
</ul>
<p>The WordPress package will be extracted into a folder called wordpress.</p>
<h3>Step 7: Delete the old WordPress files</h3>
<p>Why Delete? Generally, it is a good idea to delete whatever is possible because the uploading (or upgrading through cPanel) process may not correctly overwrite an existing file and that may cause problems later.</p>
<p><span style="color: #b92922;"><strong>DO NOT DELETE THESE FOLDERS AND FILES</strong></span></p>
<ul>
<li>wp-config.php file;</li>
<li>wp-content folder;</li>
<li>wp-images folder&#8211;only older installations from 1.5.x days will have this folder;</li>
<li>wp-includes/languages/ folder&#8211;if you are using a language file, and it is here rather than in wp-content/languages/, do not delete this folder (you might want to move your language files to wp-content/languages/ for easier upgrading in the future);.</li>
<li>.htaccess file&#8211;if you have added custom rules to your .htaccess, do not delete it;</li>
<li>Custom Content and/or Plugins&#8211;if you have any images or other custom content or Plugins inside the wp-content folder, do NOT delete them.</li>
</ul>
<p><span style="color: #b92922;"><strong>DELETE THIS FILES AND FOLDERS:</strong></span></p>
<ul>
<li>wp-* (except for those above), readme.html, wp.php, xmlrpc.php, and license.txt; files; Typically files in your root or wordpress folder. Again, don&#8217;t delete the wp-config.php file. Note: some files such as wp.php may not exist in later versions such as 2.7.</li>
<li>wp-admin folder;</li>
<li>wp-includes folder; If you have a language file here, remember not to delete the wp-includes/languages/ folder</li>
<li>wp-content/cache folder; You only see this folder if you are upgrading FROM WordPress 2.0.</li>
<li>wp-content/plugins/widgets folder; You only see this folder if you previously installed the Sidebar Widgets plugin. The Sidebar Widgets code conflicts with the built-in widget ability.</li>
</ul>
<h3>Step 8: Upload the new files</h3>
<p>With the new upgrade on your local computer, and using FTP, upload the new files to your site server just as you did when you first installed WordPress. See Using FileZilla and Uploading WordPress to a remote host for detailed guidelines in using an FTP Client to upload.</p>
<p><strong>NOTE:</strong> If you did not delete the wp-content folder, you will need to overwrite some files during the upload.</p>
<p>The wp-content folder holds your WordPress Themes and Plugins. These should remain. Upload everything else first, then upload only those WordPress files that are new or changed to your new wp-content folder. Overwrite any old versions of default plugins with the new ones.</p>
<p>The WordPress default theme has changed so you will want to upload the wp-content/themes/default folder. If you have custom changes to the default theme, those changes will need to be reviewed and installed after the upgrade.</p>
<h3>Step 9: Run the WordPress upgrade program</h3>
<p>Using a web browser, go to the WordPress admin pages at the normal /wp-admin location. WordPress will check to see if a database upgrade is necessary, and if it is, it will give you a new link to follow.</p>
<p>This link will lead you to run the WordPress upgrade script by accessing wp-admin/upgrade.php. Follow the instructions presented on your screen.</p>
<p>Note: Make sure the database user name registered to WordPress has permission to create, modify, and delete database tables before you do this step. If you installed WordPress in the standard way, and nothing has changed since then, you are fine.</p>
<p>If you want to run the upgrade script manually:</p>
<ul>
<li>If WordPress is installed in the root directory, point your browser to: http://example.com/wp-admin/upgrade.php</li>
<li>If WordPress is installed in its own subdirectory called blog, for example, point your browser to: http://example.com/blog/wp-admin/upgrade.php</li>
</ul>
<p>If you experience difficulties with login after your upgrade, it is worth clearing your browser&#8217;s cookies.</p>
<h3>Step 10: Update Permalinks and .htaccess</h3>
<p>In your Administration &gt; Settings &gt; Permalinks panel update your Permalink Structure and, if necessary, place the rules in your .htaccess file. Also see Using Permalinks for details regarding Permalinks and the .htaccess file.</p>
<h3>Step 11: Install updated Plugins and Themes</h3>
<p>Please review the Plugin Compatibility List and Theme Compatibility List, or plugin/theme authors, to find plugins and themes compatible with your new WordPress version. Upload and install new versions of your Plugins and Themes, if necessary.</p>
<h3>Step 12: Reactivate Plugins</h3>
<p>Use your Administration Panel, Plugins, to activate your Plugins. If your plugins do not appear on the Plugin Compatibility List and you are not sure if they will work correctly with the new version, activate each plugin, one at a time, and test that there are no problems before continuing.</p>
<h3>Step 13: Add security key definitions to the wp-config.php file</h3>
<p>Generate them online via: <a href="https://api.wordpress.org/secret-key/1.1/">https://api.wordpress.org/secret-key/1.1/</a></p>
<h3>Step 14: Review what has changed in WordPress</h3>
<p>Please review these resources to see what&#8217;s new in <a href="http://wordpress.org/">WordPress</a>.</p>


<p>Related posts:<ol><li><a href='http://www.monieweb.com/tutorials/quick-tip-how-to-use-your-favorite-font-in-your-website/' rel='bookmark' title='Permanent Link: Quick Tip: How To Use Your Favorite Font In Your Website?'>Quick Tip: How To Use Your Favorite Font In Your Website?</a></li>
<li><a href='http://www.monieweb.com/articles/10-useful-links-for-wordpress-designers-and-developers/' rel='bookmark' title='Permanent Link: 10 Useful Links For Wordpress Designers and Developers'>10 Useful Links For Wordpress Designers and Developers</a></li>
<li><a href='http://www.monieweb.com/tutorials/howto-install-wordpress/' rel='bookmark' title='Permanent Link: Install WordPress locally in Windows XP – (with WampServer)'>Install WordPress locally in Windows XP – (with WampServer)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.monieweb.com/articles/upgrading-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Writing Functions In PHP &#8211; Introduction</title>
		<link>http://www.monieweb.com/tutorials/writing-functions-in-php/</link>
		<comments>http://www.monieweb.com/tutorials/writing-functions-in-php/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 00:45:11 +0000</pubDate>
		<dc:creator>Monie</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.monieweb.com/?p=593</guid>
		<description><![CDATA[Thewebsqueeze blog post: This beginner PHP tutorials will teach you how to define functions, how to call functions, how to pass some simple arguments into a function and how to develop a function that can be reusable. This is the first tutorial in a series!


The real power of PHP comes from its functions. If you’re [...]


Related posts:<ol><li><a href='http://www.monieweb.com/tutorials/writing-simple-functions-php-flexibility/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Flexibility'>Writing Functions In PHP &#8211; Flexibility</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-default-values/' rel='bookmark' title='Permanent Link: Writing Functions In PHP – Default Values'>Writing Functions In PHP – Default Values</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-global-variable/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Global Variable'>Writing Functions In PHP &#8211; Global Variable</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-return-values/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Return Values'>Writing Functions In PHP &#8211; Return Values</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p class="italic"><a href="http://www.thewebsqueeze.com/web-design-tutorials/writing-functions-in-php-introduction.html">Thewebsqueeze blog post</a>: This beginner PHP tutorials will teach you how to define functions, how to call functions, how to pass some simple arguments into a function and how to develop a function that can be reusable. This is the first tutorial in a series!</p>
<p><span id="more-593"></span></p>
<h2></h2>
<p>The real power of PHP comes from its functions. If you’re looking for a way to save time when you program, look no further. Functions are going to allow us to be able to write code in one place and reuse it as many times as we want by just calling the function.</p>
<p>Creating functions lets you reuse code that you’ve used before without having to rewrite the whole thing again and again. When you understand and know how to use functions, you will be able to save a ton of time and write code in a more readable format!</p>
<h2>User-Defined Functions</h2>
<p>In PHP, there are more than 700 built-in functions. We are not going to use any of it in this tutorial but we are going to build our very own function.</p>
<p>Let’s take a look at the following typical structure of a function. When we want to declare a function, we would say function to tell PHP that we are defining a function, followed by the name of the function and any of the arguments that belong to the function.</p>
<pre class="brush: php;">
&lt;?php
   function name($arguments){
     statement;
   }
?&gt;
</pre>
<p>The name of a function can be just about anything you want. It can contain letters, numbers, underscores and dashes. It can’t contain any spaces. It must start with a letter or an underscore. Unlike string names, function names are going to be case insensitive which means that we can define a function with capital letters in it and actually called it with all lower case letters and it still finds the function and knows which one we meant. But that’s a bad programming practice and a bad habit.</p>
<p>So if you defined a function in capital letters, you call it with all capital letters. If you defined them with lowercase letters, you call it with lowercase letters. Let’s start defining our simple function.</p>
<h2>Function Without Arguments</h2>
<pre class="brush: php;">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Writing Simple Function In PHP&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php
   function say_hello(){
     echo &quot;Hello World!&quot;;
   }
   say_hello(); /* calling out the function */
?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong>Output: Hello Word! </strong></p>
<p>This simple function was executed by calling the function with say_hello(); echo out “Hello World!”.  Next we will look into another type of function with an argument passed to the function.</p>
<h2>Function With Arguments</h2>
<p><span style="text-decoration: underline"> </span></p>
<p>The reason we want to use arguments is that we want to give our functions flexibility. Flexibility is really a good and powerful thing for us because we can have code that we can reuse for different circumstances. Let’s update our first example with arguments.</p>
<pre class="brush: php;">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Writing Simple Function In PHP&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php
   function say_hello($word){
     echo &quot;Hello {$word}!&quot;;
   }
   say_hello(&quot;Everyone&quot;); /* calling out the function */
?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong>Output:  Hello Everyone!</strong></p>
<p>The same output will be printed out on your browser for this function. The only different thing about this function is its flexibility. This function has flexibility built into it because it can pass an argument and based on that argument, it can do different things in the code. This is what we called a dynamic function.</p>
<h2>Defining Functions</h2>
<p>Before we move on to a more advanced concept of function, you need to know this basic idea of defining a function.</p>
<ul>
<li>A function needs to be defined before we can call it.</li>
<li>You can’t define a function more than once.</li>
<li>You can call a function as many time as you like.</li>
<li>You can declare function inside if else statement.</li>
<li>You can declare functions inside other functions.</li>
</ul>
<h2>What&#8217;s Next?</h2>
<p>So far, you’ve learned how to define functions, how to call functions, how to pass some simple arguments into a function and how to develop a function that can be reusable.</p>
<p>In the next tutorial, I’ll be talking about more advanced tips that you can do with passing arguments into a function and some other things that we can do with functions. Stay tuned!</p>


<p>Related posts:<ol><li><a href='http://www.monieweb.com/tutorials/writing-simple-functions-php-flexibility/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Flexibility'>Writing Functions In PHP &#8211; Flexibility</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-default-values/' rel='bookmark' title='Permanent Link: Writing Functions In PHP – Default Values'>Writing Functions In PHP – Default Values</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-global-variable/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Global Variable'>Writing Functions In PHP &#8211; Global Variable</a></li>
<li><a href='http://www.monieweb.com/tutorials/writing-functions-in-php-return-values/' rel='bookmark' title='Permanent Link: Writing Functions In PHP &#8211; Return Values'>Writing Functions In PHP &#8211; Return Values</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.monieweb.com/tutorials/writing-functions-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Useful Links For Wordpress Designers and Developers</title>
		<link>http://www.monieweb.com/articles/10-useful-links-for-wordpress-designers-and-developers/</link>
		<comments>http://www.monieweb.com/articles/10-useful-links-for-wordpress-designers-and-developers/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 04:59:33 +0000</pubDate>
		<dc:creator>Monie</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.monieweb.com/?p=619</guid>
		<description><![CDATA[In this post I’ll feature 10 blog links that produce excellent content that is highly relevant to WordPress theme designers. If you do a lot of work with WordPress, either for your own site or for your clients, I recommend that you bookmark these blogs, it might be useful for you in the future.

10 Useful [...]


Related posts:<ol><li><a href='http://www.monieweb.com/articles/upgrading-wordpress/' rel='bookmark' title='Permanent Link: Quick Tip: Upgrading Wordpress'>Quick Tip: Upgrading Wordpress</a></li>
<li><a href='http://www.monieweb.com/tutorials/howto-install-wordpress/' rel='bookmark' title='Permanent Link: Install WordPress locally in Windows XP – (with WampServer)'>Install WordPress locally in Windows XP – (with WampServer)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p class="italic">In this post I’ll feature 10 blog links that produce excellent content that is highly relevant to WordPress theme designers. If you do a lot of work with WordPress, either for your own site or for your clients, I recommend that you bookmark these blogs, it might be useful for you in the future.</p>
<p><span id="more-619"></span></p>
<h2>10 Useful Wordpress Blog</h2>
<h3>Problog Design</h3>
<p><a href="http://www.problogdesign.com/"><img src="/wp-content/uploads/pro-blog-design.jpg" alt="" title="" width="598" height="180" class="alignleft size-full wp-image-640" /></a></p>
<h3>WP Beginner</h3>
<p><a href="http://www.wpbeginner.com/"><img src="/wp-content/uploads/wp-beginner.jpg" alt="" title="" width="598" height="180" class="alignleft size-full wp-image-640" /></a></p>
<h3>Theme Lab</h3>
<p><a href="http://www.themelab.com/"><img src="/wp-content/uploads/theme-lab.jpg" alt="" title="" width="598" height="180" class="alignleft size-full wp-image-640" /></a></p>
<h3>WP Arena</h3>
<p><a href="http://wparena.com/"><img src="/wp-content/uploads/wordpress-arena.jpg" alt="" title="" width="598" height="180" class="alignleft size-full wp-image-640" /></a></p>
<h3>Wp Recipes</h3>
<p><a href="http://www.wprecipes.com/"><img src="/wp-content/uploads/wp-recipes.jpg" alt="" title="" width="598" height="180" class="alignleft size-full wp-image-640" /></a></p>
<h3>WP Engineer</h3>
<p><a href="http://wpengineer.com/"><img src="/wp-content/uploads/wp-engineer.jpg" alt="" title="" width="598" height="180" class="alignleft size-full wp-image-640" /></a></p>
<h3>Theme Shaper</h3>
<p><a href="http://themeshaper.com/"><img src="/wp-content/uploads/theme-shaper.jpg" alt="" title="" width="598" height="180" class="alignleft size-full wp-image-640" /></a></p>
<h3>Digging Into Wordpress</h3>
<p><a href="http://digwp.com/"><img src="/wp-content/uploads/digging-into-wordpress.jpg" alt="" title="" width="598" height="180" class="alignleft size-full wp-image-640" /></a></p>
<h3>Wordpress Hack</h3>
<p><a href="http://wphacks.com/"><img src="/wp-content/uploads/wordpress-hack.jpg" alt="" title="" width="598" height="180" class="alignleft size-full wp-image-640" /></a></p>
<h3>Cats Who Code</h3>
<p><a href="http://www.catswhocode.com/blog/"><img src="/wp-content/uploads/cats-who-code.jpg" alt="" title="" width="598" height="180" class="alignleft size-full wp-image-640" /></a></p>


<p>Related posts:<ol><li><a href='http://www.monieweb.com/articles/upgrading-wordpress/' rel='bookmark' title='Permanent Link: Quick Tip: Upgrading Wordpress'>Quick Tip: Upgrading Wordpress</a></li>
<li><a href='http://www.monieweb.com/tutorials/howto-install-wordpress/' rel='bookmark' title='Permanent Link: Install WordPress locally in Windows XP – (with WampServer)'>Install WordPress locally in Windows XP – (with WampServer)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.monieweb.com/articles/10-useful-links-for-wordpress-designers-and-developers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Install WordPress locally in Windows XP – (with WampServer)</title>
		<link>http://www.monieweb.com/tutorials/howto-install-wordpress/</link>
		<comments>http://www.monieweb.com/tutorials/howto-install-wordpress/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 15:22:22 +0000</pubDate>
		<dc:creator>Monie</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.monieweb.com/?p=551</guid>
		<description><![CDATA[
Thewebsqueeze blog post: The most effective way of managing your website or blog is to be able to perform updates, troubleshooting for errors and optimizing images, codes and scripts in an efficient way.  What I do with all the websites that I design and maintain is to have all that process done locally on [...]


Related posts:<ol><li><a href='http://www.monieweb.com/articles/upgrading-wordpress/' rel='bookmark' title='Permanent Link: Quick Tip: Upgrading Wordpress'>Quick Tip: Upgrading Wordpress</a></li>
<li><a href='http://www.monieweb.com/articles/10-useful-links-for-wordpress-designers-and-developers/' rel='bookmark' title='Permanent Link: 10 Useful Links For Wordpress Designers and Developers'>10 Useful Links For Wordpress Designers and Developers</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img src="/wp-content/uploads/thumbnail.png" alt="how-to-install-wordpress-locally" title="how-to-install-wordpress-locally" width="150" height="150" class="alignleft size-full wp-image-360" /></p>
<p class="italic"><a href="http://www.thewebsqueeze.com/web-design-tutorials/install-wordpress-locally-in-windows-xp-with-wampserver.html">Thewebsqueeze blog post</a>: The most effective way of managing your website or blog is to be able to perform updates, troubleshooting for errors and optimizing images, codes and scripts in an efficient way.  What I do with all the websites that I design and maintain is to have all that process done locally on my PC instead of directly from the hosting server.  Not only is the access time faster and convenient, you can also do thorough testing of your website before putting them live online. For that, I created this tutorial on <b>“How to install Wordpress locally in Windows XP”</b>.</p>
<p><span id="more-551"></span></p>
<h2>Requirements</h2>
<p>Before we start, let’s check what are the basic requirements that we need for this tutorial?</p>
<ul>
<li>Windows Operating System (preferably <a href="http://www.microsoft.com/windows/windows-xp/default.aspx" target="_blank">Windows XP</a> &#8211; it is what used in this tutorial)</li>
<li><a href="http://wordpress.org/download/">WordPress</a></li>
<li><a href="http://www.wampserver.com/en/download.php">Wamp Server</a></li>
<li><a href="https://www.ohloh.net/projects/filezilla/download?filename=FileZilla_3.3.0.1_win32-setup.exe">FTP Client</a></li>
</ul>
<h2>Setting up WampServer</h2>
<p>The great thing about WampServer is it makes our job easier by installing Apache server, MySQL database and PHP all at the same time. Don’t worry about installing or how these will interact with each other.</p>
<ul>
<li>Download the latest version of <a href="http://www.wampserver.com/en/download.php">Wamp Server</a>, as of this writing it is of Version 2.0i. (Approximately 16 MB)</li>
<li>Run the setup process by double clicking the downloaded WampServer2.0i.exe file.</li>
<p>    <img src="/wp-content/uploads/wampserver_setup.png" width="503" height="392"></p>
<li>Click on &#8220;<b>Next</b>&#8221; and check the radio selection &#8220;<b>I accept the agreement</b>&#8221; and press &#8220;Next&#8221;.</li>
<p>    <img src="/wp-content/uploads/wampserver_agreement.png" width="503" height="392"></p>
<li>The default path for WampServer is &#8220;<b>C:\wamp</b>&#8220;. You can change if you want by clicking the &#8220;<b>Browse</b>&#8221; button but I do suggest you leave this in the default setting and press &#8220;<b>Next</b>&#8220;.</li>
<p>    <img src="/wp-content/uploads/wampserver_location.png" width="503" height="392"></p>
<li>Select both &#8220;<b>Create a Quick Launch Icon</b>&#8221; and &#8220;<b>Create a Desktop Icon</b>&#8221; and press &#8220;<b>Next</b>&#8220;.</li>
<p>    <img src="/wp-content/uploads/additional_task.png" width="503" height="392"></p>
<li>Click &#8220;<b>Install</b>&#8221; to begin with the installation.</li>
<p>    <img src="/wp-content/uploads/ready_to_install.png" width="503" height="392"></p>
<li>A popup box will appear and ask you to choose your default browser. Please choose your default browser to which the wamp server will be associated. I do suggest that you use Mozilla Firefox as there are so many plugins that you can add to this browser to make your programming world become more interesting and efficient. Click &#8220;<b>Yes</b>&#8221; to continue.</li>
<p>    <img src="/wp-content/uploads/detect_firefox.png"></p>
<li>&#8220;<b>Unblock</b>&#8221; the Windows Security Alert if it asks you.</li>
<li>Just leave the default values as such for the &#8220;<b>PHP Mail Parameters</b>&#8221; and click &#8220;<b>Next</b>&#8220;.</li>
<p>    <img src="/wp-content/uploads/php_mail_parameters.png" width="503" height="392"></p>
<li>Click &#8220;<b>Finish</b>&#8221; to exit the setup (Make sure that the &#8220;<b>Launch WampServer 2 now</b>&#8221; option is checked)</li>
<p>    <img src="/wp-content/uploads/launch_webserver.png" width="503" height="392"></p>
<li>Now you will see a &#8220;<b>speedometer like icon</b>&#8221; on the notification area of the taskbar (beside your taskbar clock).</li>
<p>    <img src="/wp-content/uploads/wampserver_service_error.png" width="503" height="150"></p>
<li>Just wait for sometime so that the speedometer is full white (Represents its fully ready).</li>
<li>If your WampServer is fully ready, you can skip the next step and continue reading &#8220;<b>Setting Up phpMyAdmin</b>&#8220;.</li>
<li>If it is not, that means some other server service is running at the background that makes WampServer service clashed. Most probably you have window web server (Internet Information Services &#8211; IIS) running at the time of the WampServer installation. To solve this, we need to stop the IIS. Same things goes if you want to start IIS services, you must stop the WampServer services.</li>
<li>To stop the IIS service, go to Start > Run > and type services.msc and hit the enter button. This will opens up a services control panel.</li>
<p>    <img src="/wp-content/uploads/run_services_msc.png"></p>
<li>On your right hand side, navigate and find a service called &#8220;<b>IIS Admin</b>&#8220;. Right click on it and select &#8220;<b>Stop</b>&#8220;. This will stop the IIS services.</li>
<p>    <img src="/wp-content/uploads/iis_stop_services.png"></p>
<li>Now you can restart your WampServer services by single clicking on the WampServer icon, and select &#8220;<b>Restart All Services</b>&#8220;.</li>
<p>    <img src="/wp-content/uploads/restart_wampserver.png"></p>
<li>You can now see your speedometer like icon in a full white color (Represents its fully ready).</li>
<p>    <img src="/wp-content/uploads/wampserver_service_ok.png"></p>
<li>Your Wampserver is now ready.</li>
<p>    <img src="/wp-content/uploads/wampserver_test_localhost.png">
</ul>
<h2>Setting Up phpMyAdmin</h2>
<h4>Setting up your database password</h4>
<ul>
<li>Single click on the WampServer icon, and select phpMyAdmin.</li>
<p>    <img src="/wp-content/uploads/phpmyadmin.png"></p>
<li>Select &#8220;<b>Privileges</b>&#8221; from the top menu.</li>
<li>For experimental purposes, we will use the default user i.e. root/localhost.</li>
<li>Click on the edit privileges button for the user &#8220;<b>root</b>&#8221; with the &#8220;<b>localhost</b>&#8221; host. This will opens up the &#8220;<b>Global privileges</b>&#8221; setting and navigate to the &#8220;<b>Change password</b>&#8221; portion.</li>
<p>    <img src="/wp-content/uploads/phpmyadmin_privileges.png"></p>
<li>Type in your preferred password and again to conform them. Click the &#8220;<b>Go</b>&#8221; button to apply the changes.</li>
<p>    <img src="/wp-content/uploads/phpmyadmin_change_password.png"></p>
<li>You have successfully set a password for your MySQL database. In order for you to access your database, you will need to supply/remember this password.</li>
<p>    <img src="/wp-content/uploads/phpmyadmin_edit_success.png">
</ul>
<h4>Setting up phpMyAdmin configuration setting</h4>
<ul>
<li>Once you have setup your database password, we need to supply this information into phpMyAdmin as well. We do that by single clicking the WampServer icon and select phpMyAdmin, but you will get the following error.</li>
<p>    <img src="/wp-content/uploads/phpmyadmin_config.png"></p>
<li>Before we do that, we need to create a folder named &#8220;<b>config</b>&#8221; in phpMyAdmin top level directory (C:\wamp\apps\phpmyadmin3.2.0.1\config)</li>
<p>    <img src="/wp-content/uploads/phpmyadmin_create_folder.png"></p>
<li>Once that folder is ready, navigate to: <b>http://localhost/phpmyadmin/setup/</b> in your browser.</li>
<li>The page will inform you that &#8220;<b>There are no configured servers</b>&#8221; and ask you to create a new server. Click on the &#8220;<b>Create Server</b>&#8221; button.</li>
<li>This will bring you to the &#8220;<b>Add New Server</b>&#8221; configuration page. If you are not in the &#8220;Basic settings&#8221; menu, then select &#8220;Basic settings&#8221; from the top menu.</li>
<li>Don’t bother about other things on the form. We just need to set our database password that we created earlier in this tutorial. Find a field name &#8220;<b>Password for config auth</b>&#8221; and throw in your password in that field and click the save button.</li>
<p>    <img src="/wp-content/uploads/phpmyadmin_set_password.png"></p>
<li>This will bring you to the page where the config file will be automatically generated (in your C:\wamp\apps\phpmyadmin3.2.0.1\config) but first, you have to make sure you click the save button again to make sure the config file generated successfully.</li>
<p>    <img src="/wp-content/uploads/phpmyadmin_save_config.png"></p>
<li>Once you have saved it, go in to your config folder that you created earlier (C:\wamp\apps\phpmyadmin3.2.0.1\config). There you will see a file named &#8220;<b>config.inc</b>&#8220;. What we going to do with this file is we are going to copy them and paste it into our phpmyadmin root directory (C:\wamp\apps\phpmyadmin3.2.0.1). This will override the existing file on that directory. Just click &#8220;<b>Yes</b>&#8221; to replace them.</li>
<p>    <img src="/wp-content/uploads/conform_file_replace.png"></p>
<li>All right… we are almost there! Now let’s test our phpmyadmin. Single click on the WampServer icon, and select phpmyadmin. If you can see the phpmyadmin login page, that means you have successfully setup your phpmyadmin. Congratulation! You can now login with the username: root with your password.</li>
<p>    <img src="/wp-content/uploads/phpmyadmin_login_page.png"></p>
<li>Attention! For safety and security reason, you need to delete the folder &#8220;<b>config</b>&#8221; (C:\wamp\apps\phpmyadmin3.2.0.1\config) that we created earlier. Just delete the entire folder will do you no harm. Go ahead and delete them.</li>
<li>The next step is setting up Wordpress but before we do that, we need to prepare the database that will be used by Wordpress. Let’s create a database called &#8220;wordpress&#8221;, and don’t bother about the table creation because Wordpress will automatically create for you in the Wordpress setup process.</li>
<p>    <img src="/wp-content/uploads/phpmyadmin_create_database.png"></p>
<li>Ok, we are officially finished with WampServer and phpMyAdmin. Now it is time for us to run the &#8220;<b>famous five minute WordPress installation</b>&#8221; process. Yes, you’ve heard me! It takes only five minute of your time to install them.</li>
</ul>
<h2>Setting up Wordpress</h2>
<ul>
<li>Download the latest stable copy of <a href="http://wordpress.org/download/">WordPress</a> (As of this writing it is WordPress 2.8.6)</li>
<li>After downloading, extract the files.</li>
<li>Copy and paste the WordPress folder into your www folder (C:\wamp\www).</li>
<p>    <img src="/wp-content/uploads/wamp_www.png"></p>
<li>Now, single click on the WampServer icon, and select localhost, or you could manually type this address in your browser address bar: <b>http://localhost/</b></li>
<li>As you can see, you have a new project called wordpress (which is the extracted wordpress folder that we copy and paste earlier). If you have more than one project inside the www folder, it will be listed he as well. So it is advisable to create a new folder for each of your project for easy management.</li>
<p>    <img src="/wp-content/uploads/localhost_success.png"></p>
<li>Click on the &#8220;<b>wordpress</b>&#8221; project under &#8220;<b>Your Projects</b>&#8221; in order for us to continue with our wordpress setup. This will bring us to creating our wordpress configuration file.</li>
<li>Click on &#8220;<b>Create a configuration file</b>&#8221; and then click on &#8220;<b>Let’s Go</b>&#8220;.</li>
<p>    <img src="/wp-content/uploads/wordpress_config.png"></p>
<li>Enter the value of database name, username and password (which you give before in the PhpmyAdmin)</li>
<p>    <img src="/wp-content/uploads/wordpress_database_connection.png"></p>
<li>Please remember the database name is the one that we created earlier which is &#8220;<b>wordpress</b>&#8221; and the username is &#8220;<b>root</b>&#8221; which is the default user for MySQL database. Don’t touch the &#8220;<b>Database Host</b>&#8221; and &#8220;<b>Table Prefix</b>&#8220;. Leave it as such and press &#8220;<b>Submit</b>&#8220;.</li>
<li>Now click on &#8220;<b>Run the Install</b>&#8220;.</li>
<p>    <img src="/wp-content/uploads/wordpress_run_installation.png"></p>
<li>Enter your blog title and e-mail. No need to select the box which says &#8220;<b>Allow my blog to appear in search engines like Google and Technorati</b>&#8221; since this is a local install.</li>
<li>Now click on &#8220;<b>Install WordPress</b>&#8220;.</li>
<p>    <img src="/wp-content/uploads/wordpress_blog_title.png"></p>
<li>Note that password carefully! It is a random password that was generated for you. We will change this later on in the next step by logging in with the information given.</li>
<p>    <img src="/wp-content/uploads/wordpress_installed_success.png"></p>
<li>Now login inside the WordPress using the username &#8220;<b>admin</b>&#8221; and the password you get from the previous step.(don’t select &#8220;<b>remember me</b>&#8220;, because we are going to change this password later on)</li>
<p>    <img src="/wp-content/uploads/wordpress_login.png"></p>
<li>Now you will see a reminder notice to change your password as below.</li>
<p>    <img src="/wp-content/uploads/wordpress_change_password.png"></p>
<li>Now click on &#8220;<b>Yes, Take me to the Profile Page</b>&#8220;.</li>
<li>Here you can choose your own password (all the way down the form) along with color schemes, display name, email address, website address, biography and many more. Once you have updated this information, click &#8220;<b>update profile</b>&#8220;.</li>
<li>Now you can use this WordPress Installation as same as the one you are having online.</li>
<li>You can write posts, install themes, test-drive plugins and most probably everything you can do in this local install of WordPress.</li>
<li>Enjoy blooging!</li>
</ul>
<h2>File Synchronization</h2>
<p>Now you have the updated version of your website/wordpress blog in your localhost. It is time for you to synchronize them with the online version.</p>
<p>You could do that in various way, and the most effective userfriendly way that I found so far right for me is by using FTP (provided you have web hosting that allow FTP connection).<br />
We are going to use the most popular FTP application amongst web designer/developer, so far as I know, which is <a href="http://filezilla-project.org/" target="_blank">FileZilla</a> (Client).</p>
<ul>
<li>Install FileZilla by double clicking the downloaded exe file. After successfully install them, we need to do some<br />
little configuration in order for us to establish a connection to our FTP account/hosting site. We do that by going to File ><br />
Site Manager. This will open a &#8220;<b>Site Manager</b>&#8221; popup window setting.</li>
<p><img src="/wp-content/uploads/filezilla_connection.png"></p>
<li>Click on the &#8220;<b>New Site</b>&#8221; button and name your connection &#8220;<b>Wordpress</b>&#8221; or whatever you like. On the right hand side,<br />
click on the &#8220;<b>General</b>&#8221; tab and put in your website information (Host, Logontype &#8211; set to normal, User and Password).<br />
Once done, click on the &#8220;<b>Ok</b>&#8221; button to save the configuration or &#8220;<b>Connect</b>&#8221; to start connecting to your FTP account.<br />
You can connect to yor FTP account manually by going to the file menu and again select File > Site Manager, select your<br />
connection and click on the &#8220;<b>Connect</b>&#8221; button.</li>
<p><img src="/wp-content/uploads/filezilla.png"></p>
<li>As you can see, the window is divided into two section, left and right. Left column represent your local computer<br />
(localhost) and the right column represent your remote site (Hosting). All you need to do is drag your files from the left<br />
column to the right column and your file synchronization process is finished.</li>
</ul>
<h2>Bonus – Why aren’t my Permalinks working?</h2>
<ul>
<li>You probably used Permalinks, aka PreetyURLs, in your online version of your wordpress. (<i>To learn more on PreetyURLs, I have created a tutorial specifically for learning basic htaccess. <a href="http://www.monieweb.com/tutorials/how-to-create-preety-urls/" target="_blank">Click here to learn</a></i>) Normally, this feature is automatically enabled by most web hosting but not local WampServer. In order for you to make sure the offline version of your wordpress (localhost) is functioning exactly like your online version of your wordpress, then this is the simple configuration that you should make into your Apache &#8220;<b>httpd.conf</b>&#8221; file.</li>
<li>Single click on the WampServer icon, and select Apache > httpd.conf (This is the main Apache HTTP server configuration file. It contains the configuration directives that give the server its instructions)</li>
<p>    <img src="/wp-content/uploads/apache_httpd.png"></p>
<li>The file will be open up in txt format (notepad). We need to make sure that mod_rewrite is enabled. We do this by searching for the text &#8220;<b>mod_rewrite</b>&#8221; or you can directly find this line of code: &#8220;<b>LoadModule rewrite_module modules/mod_rewrite.so</b>&#8220;.</li>
<li>At the moment, this line is commented and we need to throw away the commenting symbol which is &#8220;#&#8221; in order for our PreetyURLs to be working. Uncomment the line, save the file, restart all the WampServer services and we are done!</li>
</ul>


<p>Related posts:<ol><li><a href='http://www.monieweb.com/articles/upgrading-wordpress/' rel='bookmark' title='Permanent Link: Quick Tip: Upgrading Wordpress'>Quick Tip: Upgrading Wordpress</a></li>
<li><a href='http://www.monieweb.com/articles/10-useful-links-for-wordpress-designers-and-developers/' rel='bookmark' title='Permanent Link: 10 Useful Links For Wordpress Designers and Developers'>10 Useful Links For Wordpress Designers and Developers</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.monieweb.com/tutorials/howto-install-wordpress/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Monieweb &#8211; New Year&#8217;s Resolutions</title>
		<link>http://www.monieweb.com/news/monieweb-new-years-resolutions/</link>
		<comments>http://www.monieweb.com/news/monieweb-new-years-resolutions/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 23:02:09 +0000</pubDate>
		<dc:creator>Monie</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[competition]]></category>
		<category><![CDATA[resolutions]]></category>

		<guid isPermaLink="false">http://www.monieweb.com/?p=533</guid>
		<description><![CDATA[
2010 is here. Have you prepare your New Year&#8217;s Resolution yet? If no, it&#8217;s not too late I would say. Monieweb would like to wish you all, Happy New Year 2010 and hopefully a successful year ahead.
Upcoming informative article and tutorial from Monieweb.com this year is waiting you. Not to mention an attractive prices to [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-360" title="happy-new-year" src="/wp-content/uploads/2010.png" alt="happy-new-year" width="150" height="150" />
<p class="italic">2010 is here. Have you prepare your New Year&#8217;s Resolution yet? If no, it&#8217;s not too late I would say. Monieweb would like to wish you all, Happy New Year 2010 and hopefully a successful year ahead.</p>
<p class="italic">Upcoming informative article and tutorial from Monieweb.com this year is waiting you. Not to mention an attractive prices to be won in the up coming web design competition. Sit back, relax and enjoy the journey together&#8230;</p>
<p><span id="more-533"></span></p>
<h2>Coming up&#8230;</h2>
<p>Listed below is the most of what I can think of right now. It will be updated from time to time and I do hope you enjoy reading and learning from them.</p>
<h2>Article&#8217;s</h2>
<ul>
<li>Install WordPress locally in Windows Xp &#8211; with WampServer</li>
<li>Setting up ASP page in Windows XP &#8211; with IIS</li>
</ul>
<h2>Tutorial&#8217;s</h2>
<ul>
<li>Vanishing Point in Photoshop CS4</li>
<li>How to use any font you like in your website</li>
</ul>
<h2>Competition</h2>
<p>In conjunction with Monieweb New Year Resolutions and to celebrate this wonderful year of 2010, Monieweb is going to give away <b>special prizes</b> worth RM150 (US $59.95) to three of the most lucky article or tutorial of any topics related to web design and development world.</p>
<p>Anyone interested can send in their detail particular and attached of their article or tutorial to jeevan.m.paran@gmail.com. Closing date is on 1st March 2010.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.monieweb.com/news/monieweb-new-years-resolutions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
