Tuesday, January 29, 2008

Internet Connection Using Handphone (CDMA)


Sebelum kmu menggunakan HP CDMA untuk internet, kmu haru beli dulu kabelnya. Kebelnya terdiri dari 2 jenis yaitu DKU-5 atau CA-42. Yang asli sih Rp.300.000, tapi jgn khawatir yang biasa harganya Rp.50.000.
Sewaktu penulis pakai kabel yang Rp.50.000 tidak masalah pada HP Nokia 2115i. Bandwidth yang didapat kalau sinyal bagus 250kb, tapi kalau sinyal jelek sekitar 150kb. Gw mencobanya menggunakan provider TELKOM yaitu TelkomFlexi.
Ada 3 konfigurasi yang dilakukan yaitu INSTALL KABEL DKU-5, INSTALL MODEM CDMA UNTUK WINXP, SETUP CONNECTION.


Langkah-langkah INSTALL menggunakan Kabel DKU-5 pada WinXP adalah sebagai berikut :


1. MASUKKAN CD CDMA (biasanya kalau membeli kabel koneksi disertakan CD-nya).

2. PASANG KABEL DKU-5 ke 'USB' KOMPUTER.

3. BIASANYA WINXP AKAN MEKLAKUKAN AUTODETECT, KEMUDIAN PILIH NEXT MAKA WINXP AKAN AUTO SEARCH PADA CD.

4. SETELAH PROSES INSTALASI SELESAI COBA KLIK KANAN 'MY COMPUTER' CEK KE 'HARDWARE MANAGER' KALAU ADA PENAMBAHAN PORT DGN NAMA 'MAT USB-to-Serial Bridge' BERARTI PROSES INSTALL CABLE DKU-5 SUKSES.

5. Jika yang keluar adalah ‘prolific port’ berarti anda harus melakukan penginstallan secara manual:
-Klik kanan Prolific port

- Masuk ke Properties

- DRIVER - Update Driver

- pilih Install from a list or specific location ‘ADVANCE’

- don’t detect I will choose the driver to install

- pilih Have Disk – pilih CD-ROM dan pilih folder Driver DKU-5 XP.
Kalau setelah pilih file ada keluar 'MAT USB-to-Serial Bridge’ pilih ;Next’ dan lanjutkan proses instalasi sampai selesai.


INSTALL MODEM CDMA UNTUK WINXP

1. Masih dengan cd 'CDMA' di CD-ROM

2. MASUK KE 'CONTROL PANEL'

3. KLIK 'PHONE AND MODEM OPTIONS - MODEM'

4. KLIK 'ADD...'

5. 'DONT DETECT MY MODEM...' - NEXT

6. HAVE DISK...

7. BROWSE... KE POSISI CD-ROM - Driver Modem - OPEN - OK

8. PILIH '...3G PAKET DATA MODEM' / NEXT

9. PILIH PORT YG BARU ANDA INSTALL, KALAU SANGSI KLIK KANAN 'MY COMPUTER' CEK KE 'HARDWARE MANAGER' KALAU HAFAL POSISI PORT DGN NAMA 'MAT USB-to-Serial Bridge' di Com keberapa. Pakai posisi port tersebut utk modem.

10. TUNGGU PROSES INSTALL MODEM SAMPAI SELESAI

11. CEK KE 'PHONE AND MODEM OPTIONS' KALAU SUDAH ADA TAMBAHAN MODEM DGN NAMA '...3G PAKETDATA MODEM' BERARTI PROSES INSTALLASI SUDAH SUKSES



SETUP CONNECTION

1. START / PROGRAM / ACCESSORIES / COMMUNICATIONS / NEW CONNECTION WIZARD

2. CONNECT TO THE INTERNET / SET UP MY CONNECTION MANUALLY / CONNECT USING DIAL-UP MODEM / PILIH '...3G PAKET...'

3. ISI ISP NAME 'NAMANYA TERSERAH ANDA TERSERAH ANDA' CTH: FLEXI

4. ISI NOMOR DENGAN #777

untuk Flexi

USER NAME : telkomnet@flexi

PASSWORD : telkom


Kemudian tunggu sebentar untuk 'verifying username dan password' kemudian ....terserah anda browsingnya. Usahakan jgn browsing situs yg tidak bermanfaat ya...caauuu..!!!

Monday, January 21, 2008

Loops And Arrays

This tutorial will teach the basics behind PHP loops and arrays of variables. The loops covered are while loops and for loops.

What is a loop?
A loop is a block of code that is repeated by the processor. There are several different kinds of loops in PHP and they differ by how they are controlled.

While loop
The while loop is one of the most common loops in PHP. It checks a condition and as long as the condition is true it continues to run the loop. Here is an example of how a while loop looks:

basic code :

while (condition)
{
do this code
}

Example of a basic while loop:

PHP Code:


$i = 1;
while ($i < 10)
{
echo $i;
$i++;
}
?>


This will output “123456789″. The two plus signs after the variable i within the loop add one to the value of i. This can also be achieved by setting the variable i to i plus one.

For loop
The for loop is another common loop type in PHP. It is a bit more complicated than a while loop and requires a bit more setting up. Here is an example of how a while loop looks:

for (variable; condition; process)
{
do this code
}


What are arrays?
Arrays are a way to store sets of values into one variable. They can be accessed the same way as normal variables, but they are set differently.

Setting an array
There are multiple ways to set arrays, but first you must know some terms. The “name” of the array is the same as if you were to name a variable. The “key” of the array is what part of the array you are accessing. The “value” of the array is the value stored in a particular key.

Example of what setting and accessing a specific value looks like:


$about[‘name’] = ‘mhfuad’;
$about[‘drink’] = ‘ice tea’;
echo ‘My name is ‘ . $about[‘name’] . ‘ and I like to drink ‘ . $about[‘drink’] . ‘.’;
?>



Notice the key is place between brackets immediately after the name of the array. After that, values can be added just like if it were a normal variable.
Example of numerical key values:


$groceryList[] = ‘eggs’;
$groceryList[] = ‘butter’;
$groceryList[] = ‘milk’;
$groceryList[] = ‘cheese’;
$groceryList[] = ‘bacon’;
echo ‘The third item on our grocery list is ‘ . $groceryList[2] . ‘.’;
?>


This would output “The third item on our grocery list is milk.”. Notice how when no key is defined it is automatically set to a number. “Eggs” is the first item in the array so it is given a 0, and everything after that is just one more than that.

Using arrays in loops
Arrays can be used with loops to make loops even more useful.

Example of a for loop with an array:


$groceryList[] = ‘eggs’;
$groceryList[] = ‘butter’;
$groceryList[] = ‘milk’;
$groceryList[] = ‘cheese’;
$groceryList[] = ‘bacon’;

for ($i = 0; $i < count($groceryList); $i++)
{
echo $groceryList[$i] . ‘ ‘;
}
?>


This will output “eggs butter milk cheese bacon”. Notice the function count is used to count the number of values in the array. Also notice that it is outputing the variable named groceryList with a key set to the i value in the current loop. This is why it displays all of the values in the array.

Foreach and arrays
The for loop does a nice job going through all the values in an array if the key is numberical, but what if it isn’t? PHP has another type of loop called foreach. This goes through all the keys in an array even when the keys are not numberical.

Example of a foreach loop:

$favorite[‘movie’] = ‘Transporter’;
$favorite[‘drink’] = ‘ice tea;
$favorite[’song’] = ‘Beautiful girl’;
$favorite[‘band’] = ‘Nirvana’;

foreach ($favorite as $key => $value)
{
echo ‘My favorite ‘ . $key . ‘ is ‘ . $value . ‘. ‘;
}
?>

This will output “My favorite movie is Transporter. My favorite drink is ice tea. My favorite song is Beautiful girl. My favorite band is Nirvana.”. The setup in the parenthesis of the foreach loop is literally read as “I want to store all they keys in the favorite array into the variable $key and all the values of those keys into $value.”.