Posts Tagged "Tutorial"

Sanitisation and Validation in PHP

What Do Sanitisation and Validation Mean? Sanitisation and Validation are important terms to understand when writing PHP applications. Both in the context of this tutorial are about processes performed on user input. Sanitisation is cleaning user input to make it safe to process, and Validation is checking the data to see if it is: in the correct format; of the correct type etc. It is important to sanitise and validate data coming in from users of your PHP applications, because if it is left unchecked, the input may be used to facilitate an exploit. Some of the most common exploits involving user input are: code injection, sql injection and header injection. And we will have a look at some of these during the tutorial.

Validation is a vital topic when handling user input. It helps to improve security, improve usability and reduce the amount of bugs in your program. To validate something, we first work out a criteria which our user input has to conform to. For example, we might want the user input to be a number between 10 and 99, we then test the user input against these rules, and if the input fails the check(s) we will not use the data and inform the user that they have input something incorrect. Ok, but what does that mean in terms of code? Well here’s an example of the code you might use to test a number to see if it is between 10 and 99. Read more…

Linux Command Line Cheatsheet

Daftar di bawah ini merupakan terjemahan dari Linux.org. Semoga bermanfaat bagi anda yang sedang belajar Linux.

A

  • acpi -t Menampilkan suhu processor dalam satuan celcius
  • alias hh=’history’ Membuat alias dari sebuah perintah. Pada contoh ini hh adalah alias untuk history
  • apropos mkdir Menampilkan informasi ringkas tentang kegunaan sebuah perintah. apropos mkdir akan menampilkan kegunaan dari perintah mkdir
  • apt-cache search [package] Menampilkan daftar paket-paket yang berhubungan dengan “searched-packages”
  • apt-cdrom install [package] Memasang / meng-upgrade paket deb dari cdrom
  • apt-get install [package] Memasang / meng-upgrade paket deb
  • apt-get update Memutakhirkan daftar paket
  • apt-get upgrade Meng-upgrade semua paket-paket yang telah terpasang
  • apt-get remove [package] Menghilangkan paket deb dari sistem
  • apt-get check Memastikan resolusi yang tepat dari ketergantungan
  • apt-get clean Membersihkan cache dari jejak paket-paket yang sudah terpasang
  • arch Memperlihatkan arsitektur dari sebuah mesin
  • cat example.txt | awk ‘NR%2= =1′ Menghilangkan semua baris genap dari file example.txt
  • echo a b c | awk ‘{print $1}’ Melihat kolom pertama dalam suatu baris
  • echo a b c | awk ‘{print $1,$3}’ Melihat kolom pertama dan ketiga dalam suatu baris Read more…