Showing posts with label HTML. Show all posts
Showing posts with label HTML. Show all posts

17 May, 2014

Penyebab Web Anda Tidak Bisa Di Akses

Ada 3 komponen yang terlibat dalam akses web :
Server –> Jaringan Internet –> User
Dari ketiga hal di atas, kita bisa identifikasi sendiri apa yang jadi penyebab masalah ini.
1. Server hosting memang DOWN
Cara tercepat untuk memastikan apakah hosting Anda down adalah dengan melakukan pengecekan di downornot.com. Tinggal Anda masukkan nama domain Anda. Jika hasilnya : “namadomainanda.tld is up!”  itu artinya tidak ada masalah di server. Jika seperti itu, maka kemungkinannya ….
2. IP Address Anda diblokir oleh salah satu HOP
Perjalanan akses dari PC Anda menuju server tentunya melalui beberapa lintasan router yang disebut sebagai HOP. Jika IP Address anda ternyata diblokir oleh salah satu HOP/Router tersebut maka secara otomatis Anda tidak bisa melanjutkan perjalanan menuju server.
Nah caranya tahu dimana letak putusnya koneksi Anda ke server adalah dengan menggunakan perintah TRACE ROUTE.
Caranya yaitu (pada windows) :
1. Start -> All programs  -> Accesories -> Command Prompt
2. Ketikkan : tracert namadomain
Misal : tracert klikhost.com
Akan muncul lintasan router. Jika ada yang timed out (RTO), berarti ada hop yang bermasalah. Dan jika hasilnya putus waktu masuk ke server, berarti …
3. IP Anda terblokir oleh firewall server
Ini adalah kemungkinan yang paling sering terjadi pada hosting yang menggunakan firewall. Terutama yang menggunakan cPanel. IP Anda terblokir otomatis oleh server akibat :
- Akses yang terlalu tinggi sehingga server menganggapnya sebagai salah satu bentuk ddos. Hal ini terjadi karena Anda menggunakan IP dinamis/shared yang digunakan oleh banyak orang.
- Login ke cPanel/FTP/Email dengan menggunakan username dan pasword salah lebih dari 5 kali. Minta ke admin hosting Anda untuk melepaskan IP Address koneksi Anda dari blacklist firewall.
Dari ketiga hal di atas, setidaknya Anda tidak perlu panik saat web tidak bisa diakses atau malah buru-buru membuat surat terbuka x_x


By : klikhost

13 April, 2014

Penggunaan getElementsByTagName

getElementsByTagName

Adalah satu metode yang digunakan untuk mengambil semua elemen-elemen dengan menggunakan parameter tag.
Syntax:
ElemenHTML.getElementsByTagName(‘namaTag’)
Contoh Kasus:
Saya mempunyai tampilan HTML seperti terlihat dibawah ini:
Kursus a2fahmi.com menyedikan materi kursus sebagai berikut:
  • HTML
  • PHP
  • JavaScript
  • CSS
  • jQuery
Kode yang sudah dibuat





Keinginan:
Jadi ketika saya klik tombol tekan maka semua tulisan dalam elemen
  • akan berwarna merah seperti terlihat dibawah ini:

  • Kursus a2fahmi.com menyedikan materi kursus sebagai berikut:
    • HTML
    • PHP
    • JavaScript
    • CSS
    • jQuery
    Pertanyaan:
    Bagaimana cara membuatnya menggunakan metode getElementsByTagName … ?
    Jawaban
    Buatlah sebuah file HTML bernama daftarKursus.html lalu masukkan kode seperti dibawah ini:



    Keterangan:
    • document.getElementById(‘kursus’), Kode ini digunakan untuk mengambil elemen yang mempunyai id=’kursus’.
    • idUl.getElementsByTagName(‘li’), Kode ini digunakan untuk mengambil semua elemen yang mempunyai tag=’li’.
    • list[i].style.color=”red”, Kode ini digunakan untuk memberikan warna merah ke setiap elemen dari array list.
    Hasil:
    Jalankan file HTMLmu dan lihatlah hasilnya apakah sudah sesuai.

    22 March, 2014

    Convert timestamp to readable date time php

    Convert hasil time() pada php ke tahun, bulan, jam, menit, detik


    $time = time() // you have 1299446702 in time

    $year = $time/31556926 % 12;  // to get year

    $week = $time / 604800 % 52;  // to get weeks

    $hour = $time / 3600 % 24;    // to get hours

    $minute = $time / 60 % 60;    // to get minutes

    $second = $time % 60;         // to get seconds



    example :

    echo date('m/d/Y', 1299446702);

    19 March, 2014

    date (Unix)


    Formatting

    To format a date, a parameter string beginning with a plus sign (+) is given. The formatting specifiers below are supported by most implementations.


    Format specifiers (format string starts with +)
    SpecifierDescriptionValues or example
    Day
    %aweekday, abbreviatedWed
    %Aweekday, fullWednesday
    %dday of the month, two digits, zero filled08
    %eday of the month8
    %jday of year, zero filled001–366
    %uday of week from Monday to Sunday1–7
    %wday of week from Sunday to Saturday0–6
    Week
    %Uweek number, Sunday as first day of week00–53
    %Wweek number, Monday as first day of week00–53
    %VISO standard week of the year01–53
    Month
    %mtwo-digit month number01–12
    %hmonth name, abbreviatedMar
    %bmonth name, localised abbreviationMar
    %Blocale's full month, variable lengthMarch
    Year
    %ytwo-digit year00–99
    %Yfour-digit year2014
    %gtwo-digit year corresponding to the %V week number
    %Gfour-digit year corresponding to the %V week number
    Century
    %Ctwo century digits from year00–99
    Date
    %Dmm/dd/yy03/19/14
    %xlocale's date representation03/19/2014
    %F%Y-%m-%d2014-03-19
    Hours
    %lhour (12 hour)10
    %Ihour (12 hour), zero-filled10
    %khour (24 hour)10
    %Hhour (24 hour), zero-padded10
    %plocale's upper case AM or PM (blank in many locales)AM
    %Plocale's lower case am or pmam
    Minutes
    %Mtwo-digit minute number52
    Seconds
    %sseconds since 00:00:00 1970-01-01 UTC (Unix epoch)1395226379
    %Stwo-digit second number00–60 (Includes 60 to accommodate a leap second)
    %Nnanoseconds000000000–999999999
    Time
    %rhours, minutes, seconds (12-hour clock)10:52:59 AM
    %Rhours, minutes (24 hour clock)10:52
    %Thours, minutes, seconds (24-hour clock)10:52:59
    %Xlocale's time representation11:07:26 AM
    Date and time
    %clocale's date and timeSat Nov 04 12:02:33 EST 1989
    Time zone
    %zRFC-822 style numeric time zone-0500
    %Ztime zone name; nothing if no time zone is determinableEST, EDT
    literals: %n newline      %% percent      %t horizontal tab
    By default, date normally fills numeric fields with zeroes. GNU date, but not BSD date, recognizes a modifier between the per cent sign (%) and the format specifier:
    • hyphen (-): do not fill the field
    • underscore (_): pad the field with spaces
    TZ Specifies the time zone, unless overridden by command line parameters. If neither is specified, the setting from /etc/localtime is used.

    example
    $ date "+%m/%d/%y" 
    7/4/06
    
    $ date "+%Y%m%d"
    20060704

    To assign the time to a variable
     $ START=`date '+%r'`
     $ echo $START
     03:06:02 PM
     $ sleep 5
     $ echo $START
     03:06:02 PM
    
    N.B. the variable has the time when it was assigned.
    Yesterday assigned to variable
     $ DATE=$(date -d yesterday +"%Y%m%d")
     $ echo $DATE
     20060704
    
    The TZ environment variable specifies the time zone. Valid values are in /usr/share/zoneinfo
     $ TZ=GMT; echo "GMT: `date +\"%R (%Z)\"`"
     GMT: 12:30 (GMT)
     $ TZ=Europe/Stockholm; echo "Stockholm: `date +\"%R (%Z)\"`"
     Stockholm: 13:30 (CET)
     $ TZ=Asia/Kuala_Lumpur; echo "Kuala Lumpur: `date +\"%R (%Z)\"`"
     Kuala Lumpur: 20:30 (MYT)
     $ TZ=US/Central; echo "Dallas: `date +\"%R (%Z)\"`"
     Dallas: 07:30 (CDT)
    
    Converting between time zones Example: What time is it in Moscow when it will be 17:35 in Los Angeles
     $ TZ=Europe/Moscow date "+%F %R (%Z%z)" -d 'TZ="America/Los_Angeles" 17:35'
     2013-03-22 04:35 (MSK+0400)
    
    Other valid time strings
    GNU dateBSD dateoutput
    $ date +"%Y%m%d" -d sunday$ date -v +sun +"%Y%m%d"20060709
    $ date +"%Y%m%d" -d last-sunday$ date -v -sun +"%Y%m%d"20060702
    $ date +"%Y%m%d" -d last-week$ date -v -1w +"%Y%m%d"20060627
    $ date +"%Y%m%d" -d last-month$ date -v -1m +"%Y%m%d"20060604
    $ date +"%Y%m%d" -d last-year$ date -v -1y +"%Y%m%d"20050704
    $ date +"%Y%m%d" -d next-week$ date -v 1w +"%Y%m%d"20060711
    $ date +"%Y%m%d" -d next-month$ date -v 1m +"%Y%m%d"20060804
    $ date +"%Y%m%d" -d next-year$ date -v 1y +"%Y%m%d"20070704
    $ date +"%Y%m%d" -d "2 days ago"$ date -v -2d +"%Y%m%d"20060702
    $ date +"%Y%m%d" -d "2 months ago"$ date -v -2m +"%Y%m%d"20060504
    $ date +"%Y%m%d" -d "2 years ago"$ date -v -2y +"%Y%m%d"20040704
    To show the time in seconds since 1970-01-01 (Unix epoch):
    $ date +"%s" -d "Fri Apr 24 13:14:39 CDT 2009"
    1240596879
    
    To convert Unix epoch time (seconds since 1970-01-01) to a human readable format:
    $ date -d "UTC 1970-01-01 1240596879 secs"
    Fri Apr 24 13:14:39 CDT 2009
    
    Or:
    $ date -ud @1000000000
    Sun Sep  9 01:46:40 UTC 2001

    24 February, 2014

    Editor Text HTML Popular

    Allowing users, and clients to format their text without delving into code has long been on developers’ priority lists, but these days, providing this usability is far easier than it once was. Here are 10 WYSIWYG editors that are commonly used, and are worth a look in if its something you need for a project.

    1. NicEdit

    NicEdit
    NicEdit is an alternative to some of the larger, more complex WYSIWYG editors out there, with its small download size. It boasts many of the expected editor features and easily integrates into your site.

    2. TinyMCE

    TinyMCE
    TinyMCE is an open-source JavaScript HTML WYSIWYG editor. It’s easy to integrate, and is highly customisable with themes and plugins. TinyMCE is one of the more “complete” editors out there, offering an experience similar to MSWord.

    3. CKEditor

    CKEdior
    CKeditor is the new FCKEditor that proved to be the market leader previously. It builds from that, and aims to fix what FCKEditor got wrong. The result is a high performance WYSIWYG editor that offers editing features comparable to MSWord and Open Office.

    4. YUI Rich Text Editor

    YUI Rich Text Editor
    The YUI Rich Text Editor is a UI control from Yahoo that turns textarea’s into fully functioning WYSIWYG editors. It comes in several different versions of varying features and complexity, but still manages to achieve a great user experience without a plethora of buttons crowding the interface.

    5. MarkItUp!

    MarkItUp!
    Markitup is a jQuery plugin that allows you to turn the text areas into markup editors in any markup you wish. HTML, Wiki syntax, and BBcode are just a few that are supported. Markitup is not a WYSIWYG editor, but that doesn’t hold it back from offering all the basic features you’d expect, and a lightweight download that works well.

    6. FreeTextBox

    Free Text Box
    FreeTextBox  is an HTML editor specifically for ASP.NET. The look and feel of the editor is the most like Microsoft Word that you are likely to get. The free version does lack a couple further features, but has more than enough to get you going.

    7. MooEditable

    MooEditable
    WYSIWYG editors have become common as plugins for the popular jQuery library, but not so common on Mootools. MooEditable though, fills that void, by providing a simple, but effective user experience to the user, by building on top of  a well written JavaScript library. If you’re a Mootools fan, then you’ll have no problems with this.

    8. OpenWysiwyg

    OpenWYSIWYG
    OpenWYSIWYG is a cross browser rich text editor with almost every editing capability you could want. It features a sleek user interface including drop-downs and buttons. High on its features is its capacity to handle tables well, with different borders and colours. However, Chrome is still not supported.

    9. Spaw Editor

    SPAW Editor
    Spaw Editor is a web-based in-browser WYSIWYG editor control that enables web site developers to replace a standard text area HTML control with full-featured, fully customizable, multilingual, skinable web-based WYSIWYG editor.

    10. jHtmlArea

    jHtmlArea
    jHtmlArea is another WYSIWYG text editor built as a plugin for the popular jQuery library.  It’s purpose is to be simple and lightweight, and it serves this well, with only the most needed options included in the plugin. It allows itself to be easily customised from the looks to the functions down to the language.