Search Box

Custom Search

Thursday, January 2, 2014

Mengambil Page URL Dengan PHP

Posted by Unknown  
4:51 AM

Jika Kalian Sedang Belajar Bahasa Programing (PL) , Kali ini saya akan membahas salah satu PL yang sedang saya pelajari juga, Agar Kita sama-sama Belajar , Oke Langsung aja ya Cara Mengambil Page URL Dengan PHP nih kodenya :







<?php

// mengambil URL + URI lengkap di halaman aktif :

// beri nilai default "http" :

$url = 'http';

// kalau HTTPS terdeteksi, maka $url + "s" :

if ($_SERVER["HTTPS"] == "on") {

$url .= "s";

// nilai $url disini = "https"

}

// setelah itu $url + '://' :

$url .= "://";

// nilai $url disini = "http://" atau "https://"



// kalau server port custom (bukan port 80 atau 443) :

if ($_SERVER["SERVER_PORT"] != "80") {

// maka $url = http(s)://servername + ":" + "custom port" + "request_uri" :

$url .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];

// nilai $url disini = 'http(s)://servername:port/req_uri'

} else {

// klo port-nya default 80 :

$url .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];

// nilai $url disini 'http(s)://servername/req_uri'

}

?>



0 komentar:

Labels

Tips Dan Trik (37) IT (23) pelajaran tentang IT (23) stmik (22) OS (21) Berita (20) HTML5 (19) materi (18) tutorial (14) Sismul (13) Tizen (12) UI (11) web (11) Download (10) Download lagu (10) Android (9) Fitur (9) Meningkatkan Traffic (9) Samsung (9) TouchWiz (9) streaming (9) Aplikasi (8) Intel (8) Blackberry (7) Fakta (7) database (7) Handphone (6) oracle (6) Fungsi (5) Game (5) Lucu (5) SEO (5) optimal (5) sql (5) widget (5) PHP (4) Programing Languages (4) Smartfren (4) Spesifikasi (4) bbm (4) Andromax (3) Dollar (3) Gadget (3) Kata (3) Obsidian (3) Ads (2) CPM (2) Foto (2) Kata Bijak (2) adsense (2) celebrity (2) sosial (2) Crack (1) Error (1) Gaya Hidup (1) Gokil (1) Harga (1) Harlem Shake (1) PPC (1) Penyakit (1) Video (1) bola (1) reggae (1)

Daftar BackLink

AutoSurf Traffic Exchange: Powerful Results with SEO tips | 10KHits - 10KHits provides quality traffic hits to your personal or business websites. Auto Backlink Gratis : Filedoom Auto Backlink Gratis Indonesia : Top Link Indo
W3 Directory - the World Wide Web Directory

Site Info

SEO Reports for filedoom.blogspot.com Antispam
filedoom.blogspot.com Webutation
LinkXchanger.com
Latest Downloads

Rating for filedoblogspotom..com DMCA.com
Protected by Copyscape Online Plagiarism Finder

My Facebook

My Profil

Proudly Powered by Blogger.
back to top