Kategori
WordPress

Change WordPress Site Address

Discussion Board : change wordpress site address, for example from www.oldaddress.wordpress.com into www.newaddress.wordpress.com

Requirement : just your WordPress.com Account

Get bored with your old WordPress site address, but already have so much post in that old-site-address account?

Or maybe you have ever -or maybe often – facing this kind of problem, or, it may just me πŸ˜€ heheheh.

Well it turns out excellent WordPress by providing our service where we can change the address of our wordpress.com. Suppose our wordpress address is –> www.littleflow3r.wordpress.com

And we want to change the littleflow3rpart . For example, into www.kembangkecil.wordpress.com

Here we go, then.

  1. Login to your wordpress account. In the dashboard, choose My Blog menu.
  2. Highlight the address you want to replace wordpress (simply place the mouse cursor near your wordpress address in the list), Address Change Your menu will appear. Click on the menu.

  3. You will be redirected to WordPress.com Page Blog / Site Change Address.
  4. Read the first page of these instructions, because it is a provision that granted WordPress when you decide to change the WordPress address.
  5. Enter your new address in the field of New Blog / Site Address, and then write again in the Confirm field.
  6. In Matching username option, select Option no if you do not want to change your username (still using the old username – i recommend this one ), and select the first or second option (adjust desire) if want a new username to conform with the new address of your wordpress….
  7. In Discard Current Address field, check if you want to disable the old address of your wordpress permanently. If you are more likely to want to use your old WordPress address sometime in the future, uncheck its checkbox.
  8. Choose Continue. You will see the confirmation reviev of your setting. Choose continue.

Voilaa! Address your wordpress has changed: D Check beforehand with the opening of your blog, if the new address can not indicate the correct page, wait a while.

But remember, with frequently changing – change your wordpress blog site address, the possibility can lead to the visitors – loyal visitors wordpress you become confused (because when they visit your blog with the old address was already not be opened). Therefore, it is wise. Make changes if you are sure correctly consider the decision.

Happy Trying πŸ˜€ Happy WordPress-ing. πŸ˜€

Kategori
WordPress

Publicize : Increase Traffic to your WordPress

Discussion Board : Publicize WordPress, new WordPress feature to increase traffic to your WordPress.
Requirement : just your WordPress.com account

If you are a loyal fan of authorship activity in WordPress, and is also an active and exist in social networking, be happy about the new features provided by these WordPress. Well, that’s it , Publicize.

Publicize is one of the new features of WordPress that will allow you to share, or membroadcasting posting your WordPress automatically on your account – your social networking accounts like Twitter, Facebook, and others.
Of course this feature can increase traffic to your WordPress is not it?

To adjust the settings for this feature, you can do so by accessing the features of your WordPress Sharing Settings page. Here, you can set the service – social networking service what you want. The figure below shows an example of setting up social networking for the account.

Where did you find this Publicize feature?

1. Go to Setting – Sharing. menu
2. You will see what services has been activated, you can choose to connects or to disconnect account service here (default is Facebook, Twitter, Yahoo Updates, and Email).

How to use this this Publicize feature?
1. After setting is done, go to page Add New Post (post pages). See picture below circled in red.

2. You can choose the post you wish to be shared on social networking which account (which you’ve set / have you connects right), then do Authorize against the social networking account (you must log in to your social networking to Authorize)

In this way, every time you make a post, WordPress will membroadcast these postings on social networking account that you select automatically.

For details on how to work this feature further, you can access the official description of this feature in sini.

OK, Happy WordPress-ing πŸ˜€ and Happy Social Networking πŸ˜€

Kategori
WordPress

Publicize : Tingkatkan Traffic ke WordPress Anda

Discussion Board : Publicize WordPress, fitur baru WordPress untuk meningkatkan traffic ke WordPress anda.
Requirement : just your WordPress.com account

Kalau anda adalah penggemar setia aktifitas kepenulisan di WordPress, dan juga seorang yang aktif serta exist dalam social networking, berbahagialah dengan fitur baru yang disediakan WordPress ini. Yah, that’s it, Publicize.

Publicize adalah salah satu fitur baru WordPress yang akan memudahkan anda untuk sharing, ataupun membroadcasting postingan WordPress anda secara otomatis pada akun – akun social networking anda seperti Twitter, Facebook, dan lain sebagainya.
Tentu saja fitur ini dapat meningkatkan traffic ke WordPress anda bukan?

Untuk mengatur setting untuk fitur ini, anda dapat melakukannya dengan mengakses fitur Sharing Setting halaman WordPress anda. Disini, anda dapat mengatur servis – servis social networking apa yang anda inginkan. Gambar dibawah menunjukkan contoh pengaturan untuk akun social networking Facebook.

Where did you find this Publicize feature?

1. Masuk ke menu Setting – Sharing.
2. Anda akan melihat servis – servis apa yang telah aktif, anda bisa memilih untuk men-connect kan atau men-disconnect akun – akun servis disini (default adalah Facebook, Twitter, Yahoo Updates, dan Email).

How to use this this Publicize feature?
1. Setelah setting selesai dilakukan, pergi ke halaman Add New Post (halaman posting). Lihat gambar yang dilingkari merah dibawah ini.

2. Anda bisa memilih posting anda ingin dishare di account social networking yang mana (yang telah anda setting / telah anda connect kan), kemudian lakukan authorize terhadap akun social networking tersebut (anda diharuskan login ke akun social networking untuk authorize)

Dengan begini, setiap kali anda melakukan posting, WordPress akan membroadcast postingan tersebut di akun social networking yang anda pilih secara otomatis.

Untuk keterangan bagaimana kerja fitur ini lebih jauh, anda dapat mengakses keterangan resmi fitur ini di sini.

OK, Happy WordPress-ing πŸ˜€ and Happy Social Networking πŸ˜€

Kategori
WordPress

Mengubah Alamat Site WordPress

Discussion Board : mengubah alamat situs WordPress.com, sebagai contoh dari www.alamatlama.wordpress.com menjadi www.alamatbaru.wordpress.com

Requirement : just your WordPress.com Account

Tidak suka atau bosan dengan alamat WordPress anda, namun terlanjur memiliki banyak postingan dialamat wordpress yang lama tersebut?

Mungkin anda pernah-atau mungkin akan sering mengalami hal ini. Saya sendiri sering mengalaminya, heheheh.

Nah ternyata WordPress baik sekali dengan memberikan kita layanan dimana kita dapat mengubah alamat dari wordpress.com kita. Misal alamat wordpress kita adalah –> www.littleflow3r.wordpress.com

Dan kita ingin mengganti bagian littleflow3r tersebut. Misal, menjadi www.kembangkecil.wordpress.com

Here we go, then.

  1. Login ke halaman wordpress anda. Pada menu dashboard, pilih My Blog.
  2. Sorot ke alamat wordpress yang ingin anda ganti (simply letakkan cursor mouse di dekat alamat wordpress anda dalam daftar), menu Change Your Address akan muncul. Klik pada menu tersebut.

  3. Anda akan langsung diarahkan menuju halaman WordPress.com Blog / Site Change Address.
  4. Baca terlebih dahulu petunjuk yang ada dihalaman ini, karena merupakan ketentuan yang diberikan WordPress ketika anda memutuskan untuk mengubah alamat WordPress.
  5. Isikan alamat baru anda di field New Blog/ Site Address, kemudian tuliskan sekali lagi di field Confirm.
  6. Pada option Matching username, pilih Option no jika anda tidak ingin mengganti username anda (tetap menggunakan username yang lama — i recommend this one), dan pilih option pertama atau kedua (sesuaikan keinginan) apabila menginginkan username baru untuk disesuaikan dengan alamat wordpress anda yang baru.
  7. Pada field Discard Current Address, centang jika anda ingin men-disable alamat lama wordpress anda secara permanen. Jika anda berkemungkinan ingin menggunakan lagi alamat WordPress anda yang lama suatu saat nanti, jangan centang checkbox nya.
  8. Klik Continue. Anda akan diberi review konfirmasi dari setting anda. Pilih continue untuk melanjutkan.

Voilaa! Alamat wordpress anda sudah berganti πŸ˜€ Cek terlebih dahulu dengan membuka blog anda, apabila alamat baru belum bisa menunjukkan halaman yang benar, tunggu beberapa waktu.

Tetapi ingat, dengan sering berganti – ganti alamat situs blog wordpress anda, kemungkinan bisa menyebabkan para pengunjung – pengunjung setia wordpress anda menjadi bingung (karena ketika mereka mengunjungi blog anda dengan alamat yang lama ternyata sudah tidak bisa dibuka). Oleh karena itu, bijaksanalah. Lakukan perubahan kalau memang anda sudah benar – benar mempertimbangkan keputusan tersebut.

Selamat mencoba πŸ˜€ Happy WordPress-ing. πŸ˜€

Kategori
WordPress

WordPress Posting via Mobile

Discussion Board : Posting (and accessing wordpress) WordPress via Mobile Devices (case study : via HandPhone)
Requirements : HandPhone that already able to go through internet and a mobile browser that can be used for browsing. And a WordPress.Com account

WordPress is a blogging service that actually, enough to give attention to your comfort. For example, mobile features (if that can be called features) have existed since long, but still many people that have not used it, maybe even do not know. WordPress has long had a feature WordPress Mobile, which if you access your WordPress.com account via mobile, you are automatically redirected to a page in WordPress mobile ( m.wordpress.com ), but of course, the view WordPress page, you will be tailored to the ability of mobile devices to display your WordPress page (just a few essential services such as post, view traffic / stat, while for the setting of the other, more complex, of course, you still have to access it via computer)

Ok, We will get focus on this case study, that is for doing a blog-posting via mobile devices (m.wordpress.com)

Hoe could we post via mobile?
1. Go to WordPress.com via your mobile devices. You will be redirected to login page m.wordpress.com automatically. (or if Not, you can just access direct to the address m.wordpress.com). Insert your wordpress username and password. Then choose login.

2. You will be redirected to Stat Tab. Here you can see the traffic / stat from your wordpress blog with quite simple appearance. Choose Post Tab (or go to Post Tab with scroll down / up your handphone keypad) for start posting.

3. You will be redirected to posting page. Write your posting here, as usual.

For writing Category and tags -> separate the writing categories and tags with a comma (, ). Remember, to make sure you write categories category that already exists in your wordpress, if not, WordPress will consider a category that you write as a new category.
4. Choose Publish, for publish your post. Or choose save as draft for save your post as a draft.

p.s. But of course, all post features that more complete (such as upload images, music, files, and all the settings for that matter) not all can be found here. WordPress mobile promote the ease and simplicity to keep blogging through mobile devices . Post via mobile maybe quite simple, but quite enough to cover the needs to fill the needs of posting (title and body posts, categories, and tags.).

Happy WordPress-ing (via mobile) ! πŸ˜€

Kategori
WordPress

Posting WordPress via Mobile

Discussion Board : Melakukan posting (serta mengakses wordpress) WordPress via Mobile Devices (studi kasus : via HandPhone)
Requirements : HandPhone yang telah disetting GPRS nya sehingga dapat digunakan untuk berinternet ria, selain itu terdapat browser yang dapat digunakan untuk berinternet via handphone. WordPress.Com account

WordPress adalah layanan blogging yang sebenarnya, cukup memberikan perhatian atas kenyamanan anda. Sebagai contoh, fitur mobile (kalau bisa disebut fitur) ini telah ada sejak lama, namun masih banyak orang yang belum menggunakannya, bahkan mungkin belum tahu. WordPress telah lama memiliki fitur WordPress Mobile, dimana apabila anda mengakses account WordPress.com anda via mobile, secara otomatis anda akan di redirect ke halaman WordPress mobile (m.wordpress.com), tapi tentu saja, tampilan halaman WordPress anda akan disesuaikan dengan kemampuan mobile devices untuk menampilkan halaman WordPress anda (hanya beberapa layanan penting seperti posting, melihat traffic / stat, sedangkan untuk settingan – settingan yang lain yang lebih kompleks tentu saja anda tetap harus mengaksesnya via komputer)

Ok, kita akan fokus untuk studi kasus kali ini yaitu melakukan posting blog lewat mobile devices

Bagaimana cara kita melakukan posting via mobile?
1. Pergi ke WordPress.com via mobile devices anda. Anda akan diredirect otomatis ke halaman login m.wordpress.com (atau kalau anda tidak diredirect, langsung akses via alamat m.wordpress.com). Masukkan username dan password WordPress anda. kemudian klik Login.

2. Anda akan diredirect ke halaman Tab Stat. Disini anda bisa melihat traffic/stat dari blog WordPress anda dengan tampilan yang cukup sederhana. Klik tab Post (atau arahkan / sorot tab post dengan keypad handphone anda) untuk melakukan posting

3. Anda diarahkan ke halaman posting. Isikan postingan anda dihalaman ini.

Untuk penulisan kategory dan tag –> pisahkan penulisan kategori dan tag dengan tanda comma (,). Ingat, untuk kategori pastikan anda menuliskan kategori yang telah ada di wordpress anda, kalau tidak, WordPress akan menganggap kategori yang anda tuliskan sebagai kategori baru.
4. Klik Publish, untuk mempublish postingan anda. Atau pilih save as draft untuk menyimpan postingan sebagai draft.

p.s. Tapi tentu saja, fitur – fitur posting yang lebih lengkap (upload image, music, file, dan settingan – settingan yang lain) tidak semua bisa anda temukan disini. WordPress mobile mengedepankan kemudahan dan kesederhanaan untuk tetap blogging melalui mobile devices. Post via mobile mengedepankan ke-simple-an dalam berposting, namun cukup meng-cover kebutuhan dalam berposting (title and body post, categories, and tag.)

Happy WordPress-ing (via mobile) ! πŸ˜€

Kategori
PHP

Menghitung Karakter TextArea dalam Form dengan PHP

Studi Kasus : Membuat script untuk menghitung karakter yang tertulis dalam textarea
Kebutuhan : WebServer Package, already installed.

Mungkin kita pernah menemukan aplikasi web sms, yaitu aplikasi yang digunakan untuk mengirim sms via aplikasi web. Disini kita tidak akan membahas mengenai pemrosesan sms, namun kita akan membahas mengenai interface yang digunakan dalam mengirim sms, biasanya berbentuk textarea, yang akan memberikan batasan terhadap sejumlah karakter tertentu yang telah ditentukan (pada sms, umumnya adalah 160 karakter)
Nah. Bagaimana cara kita menghitung karakter yang tertulis dalam textarea?

Dengan Javascript.

Step 1 : Persiapkan Folder Kerja

  1. Buat folder dengan nama tutorial dalam document root anda
  2. Simpan semua file dalam praktikum ini dalam folder tutorial tersebut.

Step 2 :Membuat Form Textarea

  1. Ketikkan script berikut,
    [sourcecode language=”php”]
    <html><head>
    <title>Itx.Web.Id</title>
    <script type="text/javascript" src="cek_karakter.js"></script>
    </head>
    <body>
    <form name=form method=post>
    <h3> Write Your Message Here </h3>
    <textarea onKeyPress=cek_karakter(this.form); onKeyDown=cek_karakter(this.form); name=teks rows=4 cols=30></textarea>
    <br> <br>
    <input size=1 value=10 name=total>
    </form>
    </body>

    </html>
    [/sourcecode]

  2. Simpan dengan nama hitung_textarea.php

Step 3 : Membuat Javascript untuk Menghitung panjang Karakter

  1. Ketikkan script berikut,
    [sourcecode language=”javascript”]
    function cek_karakter(form) {
    maks = 10; // max character
    if (form.teks.value.length >= maks) {
    var message = "0 Character Left ! "; //alert if character limit reacher
    alert(message);
    form.teks.value = form.teks.value.substring(0, maks); //trim the textarea
    }
    else {
    form.total.value = maks – form.teks.value.length;} //count the character
    }
    [/sourcecode]
  2. Simpan dengan nama cek_karakter.js


Step 4 : Testing Code

  1. Pergi ke http://localhost/tutorial/hitung_karakter.php. Anda akan melihat form yang telah anda buat, dengan batasan karakter adalah 10 (bisa anda setting sendiri)
  2. Coba ketikkan sesuatu dalam textarea, maka counter akan mulai menghitung mundur, dan ketika batasan karakter telah dicapai, maka muncul alert seperti gambar dibawah
Kategori
PHP

Count TextArea Character in the Form with PHP

Case Study : Create script to count the character in the textarea
Requirements: WebServer Package, already installed.

Maybe we have ever find sms web application, ie applications that are used to send sms via web applications. Here we will not discuss about the processing of SMS, but we will discuss about the interface that is used in sending sms, usually in the form textarea, which will provide certain limitations on number of characters that have been determined (on sms, generally is 160 characters)

Nah. How do we calculate the characters written in the textarea?

With Javascript.

Step 1 : Prepare the work directory

  1. Create folder named tutorphp in your document root
  2. Save all file in this tutorial in this folder.

Step 2 :Create Form Textarea

  1. Type the following script,
    [sourcecode language=”php”]
    <html><head>
    <title>Itx.Web.Id</title>
    <script type="text/javascript" src="cek_karakter.js"></script>
    </head>
    <body>
    <form name=form method=post>
    <h3> Write Your Message Here </h3>
    <textarea onKeyPress=cek_karakter(this.form); onKeyDown=cek_karakter(this.form); name=teks rows=4 cols=30></textarea>
    <br> <br>
    <input size=1 value=10 name=total>
    </form>
    </body>

    </html>
    [/sourcecode]

  2. Save with the name hitung_textarea.php

Step 3 : Create Javascript to Count Character in the Textarea

  1. Type the following script,
    [sourcecode language=”javascript”]
    function cek_karakter(form) {
    maks = 10; // max character
    if (form.teks.value.length >= maks) {
    var message = "0 Character Left ! "; //alert if character limit reacher
    alert(message);
    form.teks.value = form.teks.value.substring(0, maks); //trim the textarea
    }
    else {
    form.total.value = maks – form.teks.value.length;} //count the character
    }
    [/sourcecode]
  2. Save with the name cek_karakter.js


Step 4 : Testing Code

  1. Go to http://localhost/tutorial/hitung_karakter.php. You’ll see a form that you created, with the character limit is 10 (you can set yourself)
  2. Try typing something in the textarea, then the counter will start counting down, and when the character limit has been reached, the alerts appear as shown below
Kategori
PHP

Menghitung Karakter TextArea dalam Form PHP

Studi Kasus : Membuat script untuk menghitung karakter yang tertulis dalam textarea

Kebutuhan : WebServer Package, already installed.

Mungkin kita pernah menemukan aplikasi web sms, yaitu aplikasi yang digunakan untuk mengirim sms via aplikasi web. Disini kita tidak akan membahas mengenai pemrosesan sms, namun kita akan membahas mengenai interface yang digunakan dalam mengirim sms, biasanya berbentuk textarea, yang akan memberikan batasan terhadap sejumlah karakter tertentu yang telah ditentukan (pada sms, umumnya adalah 160 karakter)

Nah. Bagaimana cara kita menghitung karakter yang tertulis dalam textarea?

Dengan Javascript.

Step 1 : Persiapkan Folder Kerja

  1. Buat folder dengan nama tutorial dalam document root anda
  2. Simpan semua file dalam praktikum ini dalam folder tutorial tersebut.

Step 2 :Membuat Form Textarea

  1. Ketikkan script berikut,

    [sourcecode language=”php”]</p>
    <p>&lt;html&gt;&lt;head&gt;</p>
    <p>&lt;title&gt;Itx.Web.Id&lt;/title&gt;</p>
    <p>&lt;script type=&quot;text/javascript&quot; src=&quot;cek_karakter.js&quot;&gt;&lt;/script&gt;</p>
    <p>&lt;/head&gt;</p>
    <p>&lt;body&gt;</p>
    <p>&lt;form name=form method=post&gt;</p>
    <p>&lt;h3&gt; Write Your Message Here &lt;/h3&gt;</p>
    <p>&lt;textarea onKeyPress=cek_karakter(this.form); onKeyDown=cek_karakter(this.form); name=teks rows=4 cols=30&gt;&lt;/textarea&gt;</p>
    <p>&lt;br&gt; &lt;br&gt;</p>
    <p>&lt;input size=1 value=10 name=total&gt;</p>
    <p>&lt;/form&gt;</p>
    <p>&lt;/body&gt;</p>
    <p>&lt;/html&gt;</p>
    <p>[/sourcecode]

  2. Simpan dengan nama hitung_textarea.php

Step 3 : Membuat Javascript untuk Menghitung panjang Karakter

  1. Ketikkan script berikut,

    [sourcecode language=”javascript”]</p>
    <p>function cek_karakter(form) {</p>
    <p>maks = 10; // max character</p>
    <p>if (form.teks.value.length &gt;= maks) {</p>
    <p>var message = &quot;0 Character Left ! &quot;; //alert if character limit reacher</p>
    <p>alert(message);</p>
    <p>form.teks.value = form.teks.value.substring(0, maks); //trim the textarea</p>
    <p>}</p>
    <p>else {</p>
    <p>form.total.value = maks – form.teks.value.length;} //count the character</p>
    <p>}</p>
    <p>[/sourcecode]

  2. Simpan dengan nama cek_karakter.js

Step 4 : Testing Code

  1. Pergi ke http://localhost/tutorial/hitung_karakter.php. Anda akan melihat form yang telah anda buat, dengan batasan karakter adalah 10 (bisa anda setting sendiri)

  2. Coba ketikkan sesuatu dalam textarea, maka counter akan mulai menghitung mundur, dan ketika batasan karakter telah dicapai, maka muncul alert seperti gambar dibawah

Kategori
PHP

Delete Multiple Data with PHP

Case Study : Create function to delete multiple data on the database with checkbox component
Requirements : Webserver Packages, already installed.

Multi-delete Checkbox like in Gmail, we can choose to delete a message in our inbox smply by clicking the checkbox on the data that we want to remove. This tutorial will create a sample application to remove the data – specific data which is marked by checkbox (like in Gmail).

Ok, let’s get into the tutorial.

Step 1 : Prepare the Database

  1. Create database named db_tutorial
  2. Prepare a table named tb_kota, with structure like picture below,
  3. Insert some sample data like below,
  4. Done!

Step 2 : Prepare the work directory

  1. Create folder named tutorphp in your document root
  2. Save all file in this tutorial in this folder.

Step 3 : Create a connection to DB script

  1. Type the following script,
    [sourcecode language=”php”]
    <?php
    $host = "localhost";
    $user = "root";//adjust according to your mysql setting
    $pass = ""; //adjust according to your mysql setting, i use no password here
    $dbName = "db_tutorial";
    mysql_connect($host, $user, $pass);
    mysql_select_db($dbName)
    or die ("Connect Failed !! : ".mysql_error());
    ?>
    [/sourcecode]
  2. Save with the name connect.php

Step 4 : Script to Show the Data

  1. Type the following script,
    [sourcecode language=”php”]
    <html><head>
    <title>Itx.Web.Id</title>
    <script type="text/javascript" src="pilihan.js"></script>
    <script type="text/javascript" src="warning.js"></script>
    </head>
    <body>
    <h2> The Data <h2>
    <?php
    include ‘connect.php’;
    $query = "SELECT * FROM tb_book"; //the query for get all data in tb_student
    $result = mysql_query($query);
    ?>

    <form name="myform" method="post" action="prosesdeletemulti.php">

    <?php
    echo "<table border=’0′ cellpadding=’2′ cellspacing=’2′>";
    echo "<tr bgcolor=’orange’>
    <td> <b> Title </b> </td>
    <td> <b> Author </b> </td>

    </tr>";

    $i = 0;
    while ($data = mysql_fetch_array($result)) { //mysql_fetch_array = get the query data into array
    echo "<tr>
    <td>".$data[‘title’]."</td>
    <td>".$data[‘author’]."</td> "; ?>
    <td><input type="checkbox" name="id[<?php echo $i;?>]" value="<?php echo $data[‘id’];?>" /></td>
    <?php
    $i++;
    }
    echo "</table>";
    ?>
    <td> <input type="submit" value="Delete" onClick="return warning();" name="submit">
    <input type="reset" value="Cancel" name="reset"> </td>
    </form>
    </body>

    </html> [/sourcecode]

  2. save with the name student_data1.php

Step 5 : Create javascript to show warning

  1. Type the following script,
    [sourcecode language=”javascript”]
    function warning() {
    return confirm(‘Are You Sure to Delete This Data?’);
    }
    [/sourcecode]
  2. save with the name warning.js

Step 6 : Javascript to get the checkbox ed component

  1. Type the following script,
    [sourcecode language=”javascript”]
    function pilihan()
    {
    // read the component from ‘myform’
    var jumKomponen = document.myform.length;
    // no check all
    if (document.myform[0].checked == false)
    {
    for (i=1; i<=jumKomponen; i++)
    {
    if (document.myform[i].type == "checkbox") document.myform[i].checked = false;
    }
    }
    }
    [/sourcecode]
  2. save with the name pilihan.js

Step 7 : Script to process delete multiple data

  1. Type the following script,
    [sourcecode language=”php”]
    <?php
    include ‘connect.php’;
    $data = $_POST[‘id’]; //get all the id book that will be deleted

    foreach($data as $data1) { //looping according to the total data that checked
    //echo $data1;
    $query = "DELETE FROM tb_book where id = $data1"; //the query to delete data according to id
    $result = mysql_query($query);
    }
    if ($result) {
    include "student_data1.php";
    echo "Delete sucess";
    }
    ?>
    [/sourcecode]

  2. save with the name prosesdeletemulti.php

Step 8 : Testing Code

  1. Go to http://localhost/tutorphp/student_data1.php. Check the checkbox on the data where you will delete the data.
  2. Warning appear. Choose Ok.
  3. Success confirmation appear, and the data really has been deleted. Check your database also πŸ˜€

For the script explanation.. see script comment. and feel free to comment πŸ˜€

OK. Haaaaaaaapppy Coding! πŸ˜€