1 / 8

Skrip ASP harus disimpan di sebuah web server internet

Syarat untuk menjalankan skrip ASP. Skrip ASP harus disimpan di sebuah web server internet Untuk penggunaan di jaringan lokal (LAN) atau personal computer (PC), diperlukan server jaringan lokal dengan web server Microsoft Internet Information Server (IIS) versi 4 ke atas.

lilli
Download Presentation

Skrip ASP harus disimpan di sebuah web server internet

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Syaratuntukmenjalankanskrip ASP • Skrip ASP harus disimpan di sebuah web server internet • Untuk penggunaan di jaringan lokal (LAN) atau personal computer (PC), diperlukan server jaringan lokal dengan web server Microsoft Internet Information Server (IIS) versi 4 ke atas. • Jika sudah terinstall Microsoft Internet Information Server (IIS) , maka untuk menjalankan file ASP pada browser, tuliskan alamat berikut ini: • http://localhost/ • http://localhost:81/

  2. Aturanpenulisan ASP Script ASP dituliskan diantara tag <%...%> dan dapat diletakkan di bagian mana saja pada sebuah file HTML. File : latihan01.asp <HTML> <BODY> <P>Berita Seputar Malang, tanggal : <% =Date %> <BR> Dipersembahkan oleh MalangOnline.com</P> <% Response.Write “Halaman ini diprogram dengan ASP” %> </BODY> </HTML>

  3. PERNYATAAN IF…THEN…ELSE If kondisil Then [pernyataan1] ………. Else [pernyataan2] ………. End If Bentuk Umum: contoh: <% dim HP HP = "Samsung" Response.write "HP saya adalah : " Response.write HP Response.write "<br>" If HP = "Nokia" Then Response.write "HP kita sama donk…….." Else Response.write "HP kita lain ya..." End If %>

  4. MENAMPILKAN TANGGAL DAN WAKTU PADA ASP File: latihan03.asp <html> <title>menampilkan Tanggal dan Waktu</title> <body> <pre> Tanggal Saat ini : <% =date() %> Waktu : <% =time() %> Tanggal : <% =day(date) %> Bulan : <% =month(date) %> Tahun : <% =year(date) %> Hari Ke : <% =weekday(date) %> Jam : <% =hour(time) %> Menit : <% =minute(time) %> Detik : <% =second(time) %> </pre> </body> </html>

  5. <html><body> <% dim hari,tgl tgl=date() hari=weekday(date) if hari=1 then hari= "Minggu" elseif hari=2 then hari= "Senin" elseif hari=3 then hari= "Selasa" elseif hari=4 then hari= "Rabu" elseif hari=5 then hari= "Kamis" elseif hari=6 then hari= "Jumat" elseif hari=7 then hari= "Sabtu" End if Response.write "Tanggal Hari Ini : " & hari & ", " & tgl %> </body></html> Buatlah script ASP untuk menampilkan hari dan tanggal, seperti berikut ini: Rabu, 16 Januari 2013 File tugas di ZIP atau di RAR terlebih dahulu, diberi nama sesuai dengan NIM, dikumpulkan pada komputer depan, di folder: E:\Praktikum ASP

  6. PERNYATAAN SELECT…CASE • Select Case digunakanuntukmembuatpilihandaribanyakpilihansebagaicara lain penggunaan If.. .Then.. .Else. • Bentukumumnyaadalahsebagaiberikut: • Select Case Ekspresi • Case NilaiEkspresi 1 • Pernyataan 1 • Case NilaiEkspresi 2 • Pernyataan 2 • Case NilaiEkspresi 3 • Pernyataan 3 • Case NilaiEkspresi 4 • Pernyataan 4 • End Select

  7. <html><body> <% dim hari,tgl tgl=date() hari=weekday(date) Select Case hari Case 1 Response.Write "Minggu, " & tgl Case 2 Response.Write "Senin, " & tgl Case 3 Response.Write "Selasa, " & tgl Case 4 Response.Write "Rabu, " & tgl Case 5 Response.Write "Kamis, " & tgl Case 6 Response.Write "Jumat, " & tgl Case 7 Response.Write “Sabtu, " & tgl End Select %> </body></html> Catatan: Cekterlebihdahulu IIS dikomputerygandagunakan, ketikpada browser: http://localhost/ Sebelum data disimpanbuatlahterlebihdahulu folder untukmenyimpan data pada: C:\Inetpub\wwwroot\ Misalkanandamembuat folder Ali C:\Inetpub\wwwroot\Ali\ Cara menjalankanpada file browser: http://localhost/Ali/Latihan01.asp

  8. <html> <body> <% dim tgl tgl = date() Response.Write "Tanggal Hari Ini : " & tgl Select case day(tgl) case 1,2,3,4,5,6,7,8,9,10 Response.Write("<P>Sekarang Awal Bulan</P>") Case 11,12,13,14,15,16,17,18,19,20 Response.Write("<P>Sekarang Pertengahan Bulan</P>") case 21,22,23,24,25,26,27,28,29,30,31 Response.Write("<P>Sekarang Akhir Bulan</P>") end select if day(tgl) = 28 then Response.Write "Hari ini Gajian" else Response.Write "Belum Gajian Nih..!" end if %> </body> </html>

More Related