Wednesday, December 21, 2011

Excel Tips: Joining or Concatenating Text Strings

What is Concatenate

Joins several text strings into one text string and up to 30 strings can be joined using syntax below.

Syntax
CONCATENATE (text1,text2,text3...)
Ampersand & can also be used as calculation operator instead of the CONCATENATE function to join text items.

As shown below, we can get full name by concatenating last name, first name and middle name. I also used IF() and ISBLANK() function so that we can get nice results for blank or empty middle name.

Formula Example 1
=CONCATENATE(B3,", ",A3," ",LEFT(C3,1),IF(ISBLANK(C3),"","."))
Formula Example 2
=B12&", "&A12&" "&IF(ISBLANK(C12),"",LEFT(C12,1)&".")
Double click cells under Full Name(Column D) to see actual formula used.

Monday, December 12, 2011

Welcome!

Welcome to Web Tutorial Plus!

Web Tutorial Plus! is all about sharing How-To tutorials plus Tips and Guides related to Web Programming (PHP), HTML, CSS, Photoshop, Excel, Blogger etc.which I've learned.

If you have questions or you need tutorials related to topics above, please leave a comment or join/follow this site so that I can post it when I'm not busy.


Thank You for coming!
Henry

Disclaimer

Privacy

The owner of this blog does not share personal information with third-parties nor does the owner store information is collected about your visit for use other than to analyze content performance through the use of cookies, which you can turn off at anytime by modifying your Internet browser’s settings. The owner is not responsible for the republishing of the content found on this blog on other Web sites or media without permission.

Blog Comments

The owner of this blog reserves the right to edit or delete any comments submitted to this blog without notice due to comments;
  1. Deemed to be spam or questionable spam
  2. Including profanity
  3. Containing language or concepts that could be deemed offensive
  4. That attack a person individually
Terms and Conditions

All content provided on this blog is for information purposes only. The owner of this blog makes no representations as to the accuracy or completeness of any information on this site or found by following any link on this site. The owner will not be liable for any errors or omissions in this information nor for the availability of this information. The owner will not be liable for any losses, injuries, or damages from the display or use of this information.

This policy is subject to change at anytime.

Sunday, December 11, 2011

PHP Numbers

Since we know what numbers are, lets look the following examples how to deal numbers using PHP.

Math Operations

It will echo back 12+4+$value1 and multiplied by $value2 then divided by 2 minus 5
$value1 = 4;
$value2 = 5;

echo ((12 + 4 + $value1) * $value2) / 2 - 5; // result is 45
Using +=, -=, *= and /= will update the value of $price
$price = 8;

echo $price += 8; echo ', '; // new value of $price = 16
echo $price -= 8; echo ', '; // new value of $price = 8
echo $price *= 8; echo ', '; // new value of $price = 64
echo $price /= 8; echo ', '; // new value of $price = 8
Incrementing (go up by 1)
$student = 4;

$student++; echo $student; // result is 5
Decrementing (go down by 1)
$student = 4;

$student--; echo $student; // result is 3

Saturday, December 10, 2011

PHP Strings

A string is series of characters, where a character is the same as a byte, so PHP only supports a 256-character set.

How to use Strings

Single quoted strings
echo 'Hello World';
Double quoted strings
echo "Hello World";
Double quoted strings with variable
echo "$var1 Hello World";
Double quoted strings with variable inside curly braces
echo "{$var1} Hello World";
Concatenating Strings
echo "Hello" . " World";
echo "Hello" . $var1;
echo getvar1() . "Hello";

PHP Variables

As many programming language define, variables is a symbolic representation of a value.

A valid variable name:
  1. Starts with a dollar sign ($)
  2. Followed by either a letter or underscore
  3. Can contain numbers, numbers, underscores, dashes (hyphen)
  4. Case-Sensitive
  5. No spaces
Variable name examples:
$Products;
$salePrice;
$sale_price;
$item3;
$_itemName;
$__itemPrice;
Avoid these variable format:
$_itemPrice; //PHP defined variables, $_POST, $_GET etc.
$__itemPrice; //double/triple/four underscore can be confusing
Lets take Variables in action:
<html>
    <head>
        <title>PHP Variables</title>
    </head>
    <body>
        <?php
        $price1 = 25;
        echo $price1 . '<br />';
        $products = 'product lowercase';
        $Products = 'product uppercase';
        echo $products . '<br />';
        echo $Products . '<br />';
        $price1 = 500;
        echo $price1;
        ?>
    </body>
</html>

Friday, December 9, 2011

PHP Basics

Before proceeding, i suggest to install XAMPP in your computer first if you still don't have server set up for testing and practicing PHP.

How to Embed PHP?

Using PHP tag (standard tag) or PHP block tells the server to execute php.
<?php ?>
PHP shorthand tags or short open tags, this will still work but its considered bad practice.
<? ?>
or
<?= ?>
Create a new php file using your available text editor (Notepad, Notepad++, Komodo Edit, etc.). Name it whatever you like, copy the codes below and save it.
<html>
    <head>
        <title>PHP Embedding</title>
    </head>
    <body>
        <?php echo 'Hello World'; ?><br />
        <?php echo 'Hello' . ' World <br />'; ?>
        <?php echo 18+5; ?>
    </body>
</html>
Open your browser (Internet Explorer, Firefox, Chrome, Opera, etc.) and type this URL http://127.0.0.1/ or http://localhost/ followed by php file name. Example: http://localhost/helloworld.php.

PHP Comments

Because we want to be a good programmer, it is important to use comments into our code so that we're able to quickly understand what the code or function commands especially very large complex programming.

We can make comments in PHP using the following:
<html>
    <head>
        <title>PHP Comments</title>
    </head>
    <body>
        <?php
        // single-line comments
        
        # single-line comments
        
        /* multi line comments
        multi-line comments
        multi-line comments
        multi-line comments
        multi-line comments
        multi-line comments */
        ?>
    </body>
</html>

Tuesday, December 6, 2011

How to Install and Configure XAMPP



What is XAMPP?

XAMPP is an open source or free cross-platform web server package, consist of the following:
  • Apache HTTP Server
  • MySQL database
  • Interpreters for scripts written in the PHP and Perl programming languages


Used to

To allow website designers and programmers to test their work on their own computers without any access to the Internet. XAMPP also provides support for creating and manipulating databases in MySQL using PhpMyAdmin, so it's officially designed for use only as a development tool.



Installation

Using installer version is the easiest way installing XAMPP.


I recommend to install at default settings but if you know what you're doing do so. Click finish.




Configuration

After the installation completed, you will find XAMPP shortcut on your desktop which runs the XAMPP Control Panel to start or stop all server (Apache, MySQL and FileZilla), also to install or uninstall services.


To test XAMPP go to these address http://localhost/ or http://127.0.0.1/ and select your prefer language if prompted. Under the Tools section browse to phpMyAdmin.



Security

By default phpMyAdmin has a username of  root  but no password, it's a good practice to always have your phpMyAdmin protected and secured. To enable MySQL security on XAMPP go to http://localhost/, and browse to Security.


Under the Security page, go to http://127.0.0.1/security/xamppsecurity.php to access Security console MySQL and XAMPP directory protection.


There you go, MySQL databases on PhpMyAdmin are now secured which you can access here, then log in using username as  root (default) and your password.



Where should I put my PHP for testing?

You can save PHP files to this directory "C:\xampp\htdocs\" if you install XAMPP by default or you can locate it by using XAMPP Control Panel Application. Click Explore button and look for htdocs folder.




Sunday, December 4, 2011

PHP Overview


What is PHP?
  • PHP: Hypertext Preprocessor
  • General-purpose Server-side Scripting Language
  • Designed for Web Development (HTML)
  • Add flexibility to HTML
  • Syntax is similar to ASP, C, Java, Perl

Why use PHP?
  • Open Source or Free to use
  • Cross platform (Windows/Mac/Linux)
  • Powerful and Scalable
  • Specifically used for Web Development
  • Can be Object Oriented (ver. 5)
  • Great Documentation (in many languages)
  • Large active developer community like Wordpress, Joomla, PhpBB, etc.

What is needed to practice PHP?