150 likes | 295 Views
Programming 1 PHP. Material. Ebook PHP in 10 Minutes – Chris Newman – Sams Teach Yourself PHP4 in 24 Hours - Sams Dasar Pemrograman Web Dinamis menggunakan PHP – Abdul Kadir – Andi Offset. PHP. Server Side Scripting
E N D
Material • Ebook • PHP in 10 Minutes – Chris Newman – Sams • Teach Yourself PHP4 in 24 Hours - Sams • DasarPemrograman Web Dinamismenggunakan PHP – Abdul Kadir – Andi Offset
PHP • Server Side Scripting • Installed more than 244 million website and 2.1 million web server • Invented by RasmusLerdorf in 1995 • PHP Personal Home Page PHP: Hypertext Preprocessor Source: wikipedia.org/wiki/PHP
Server Side Scripting • Executed by server • Example Cold Fusion, Perl, ASP (Active Server Page), ASP.NET, JAVA, VB Script
Client Side Scripting • Executed by client • Example Java Script, Ajax, Jquery, Actionscript
Prerequisite • HMTL • CSS • Java Script
How to use • Install on local computer • Wamp • Xampp • Appserv • …… • Install on server (Linux or Windows) • Manual http://www.php.net/manual/en/
Hello world <?php echo “Hello World – PHP” ; print “Hello World”; ?>
Fungsi date <?php echo date(“j F Y”); //show the calendar ?> <?php echo “date(“H i s”)”; //show the time ?> Buat web sederhana yang berisiinformasitanggaldan jam.
Comment • Giving command on php script. Is it important, why? /* comment 1 comment 2 */ //Formula for counting tax. Edited 10/12/12
Variable • Boolean • Integer • Double or Float • String *Variable on PHP is Case Sensitive
Variabel (cont’) $angka = 1; $nama = “YagusCahyadi”; ------------------------------------- Example. $name = “Kelas SI”; echo “Hi Mahasiswa,”; echo $name; Output. Hi Mahasiswa, Kelas SI
Expression $a = 10; $b = 40; $tambah = $a + $b; echo $tambah; Output. ?
Expression (cont’) $my_age = 29; $vicky = “my_age”; echo “ Vicky bilangkalau $vicky is {$my_age}”; Output. Vicky bilangkalaumy_age is 29
Exercise 1 • Buatlah program untukoperasi string. • Buatlah program untukoperasiangka. *asumsitidakperlumemasukkan input *dibuatdalam 1 page/halaman.