Rabu, 17 Desember 2008

BUAT COUNTER DARI PHP- DENGAN MY SQL

Baris I bertugas membuat sebuah formulir isian. Yang perlu kamu perhatikan di sini adalah parameter ACTION. Dalam parameter ini kamu harus menentukan nama file yang akan dieksekusi setelah klik pada tombol kirim.
Baris II akan memunculkan kata Nama : diikuti sebuah kolom yang bisa diisi oleh pengunjung dengan nama mereka. Parameter penting di sini adalah NAME. Kamu bisa mendefinisikan sebuah nama sebagai tempat menyimpan hasil pengisian si pengunjung tadi. Nah isi parameter NAME tersebut (dalam kasus ini nama) akan dapat diambil isinya oleh file bukutamu.php sebagai variabel $nama.
Gampang to?
Baris III penjelasannya sama, dengan nama variabelnya adalah $pesan.
Baris IV akan menampilkan tombol bertuliskan kirim.Ternyata ndak terlalu rumit kan?
Guaampang ko. :)
nah, kalau sudah mudeng, kita akan bikin file bukutamu.php yang akan memasukkan isi dari input nama dan pesan ke dalam tabel yang sudah kita buat sebelumnya.Buat database counter
CREATE TABLE `count` (`value` int(50) NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1;Ketikkan script dibawah ini dan simpan dengan nama counter.php//Membuat koneksi ke server//mysql_connect ( [string server [, string username [, string password [, bool new_link [, int client_flags]]]]])mysql_connect(”localhost”,”root”,”");//memilih database$sql = mysql_query(”SELECT * FROM counter.count”);$result = mysql_fetch_row($sql);//variable$getcount = $result[0];$addcount = $result[0] + 1;//strlen - berfungsi untuk menentukan panjang karakter$lengthchar = strlen($getcount);//query$update = mysql_query(”UPDATE counter.count
SET value=’$addcount’ where value=’$getcount’”);//menampilkan image counterfor($i=0 ; $i<=$lengthchar ;$i++) {//substr - Return part of a string$showimg = substr($getcount,$i,1).”.gif”;echo “”;Setelah itu buat gambar untuk angka dari 0 sampai 9 dengan penamaan 0.gif, 1.gif ….9.gif dan simpan dalam folder image.
Selamat mencoba!!!!!!!!

Tidak ada komentar:

my picture

my picture

G3neRal TIPs to be SMart


Here are a few general tips to keep in mind when you start student teaching.

Be flexible. Even the best plans for lessons, projects and homework sometimes just don’t go as you expected. Try to keep things flexible so you won’t be completely derailed when students don’t respond the way you hope.

Prepare for the unexpected. Along those same lines, when the unexpected does happen, make sure you’re ready for it. Keep a few backup lessons on hand so you won’t be left out in the cold if you need something to keep your students busy.

Learn from other teachers. You’re student teaching in order to get an idea of how to teach, so what better way to supplement your experience than to ask questions and learn from those who are already in the field?

Talk to parents. Learning to work with parents can be difficult, but it’s a necessary component of being a teacher. Make sure to keep parents informed of their child’s progress.
Share your personal skills.


Each person brings a different set of skills to the table when they start student teaching. For instance, if you’re a great artist, try incorporating art into your student’s lessons.

Watch what you say. Those just entering student teaching can have a hard time remembering that what they say and do must be closely monitored, both in front of students and other faculty members. You never know what could come back to bite you, so keep your comments to yourself when at school or in public.

Learn to prioritize. This can be a good rule for life in general, but it’s especially important when you’re teaching students. Figure out what parts of the lessons are most important and concentrate your energy on those.

Find out how your school is run. You’ll make things a lot easier on yourself by figuring out the little day to day operations of the school you’ll be working for. Speak with administrators and cooperating teachers to get the information you’ll need to keep things running smoothly.

Plan, plan, plan. When you’re starting out in teaching, you can’t ever plan too much. While it may seem tedious to spend hours planning out every detail of your classes, it can be a good way to keep you feeling confident until you really get the hang of teaching.

Create simple rules. The best rules are those that are easy for your students to remember. Keep things simple and lay out some simple guidelines for students to follow to keep them well-behaved and attentive during class.
Focus on what you do know. Student teachers and those just starting out in the field will sometimes feel like what they don’t know far outweighs what they do know. However true this may be, try focusing on what you do know instead. The rest will come in time.

Don’t try to do it all at once. Many student teachers go into their classrooms with a million ideas for lessons. However, you’ll give yourself a heart attack running around trying to do all the things you want to do at one time, so focus on fully exploring a few of your ideas at a time.

Ask questions. Don’t know something? Just ask. Those around you are there to help, so take advantage of their experience and knowledge as you work through your student teaching.

Learn about the experience. While reading doesn’t compare to real life experience, it can help prepare you and give an idea of what to expect. Read articles and books about student teaching to help prepare you for the months to come.

Enjoy it! At the end of the day, student teaching should be a fun and rewarding experience. Make sure you’re not so wrapped up in doing well that you aren’t taking the time to truly enjoy and appreciate it.