Fungsi dalam PHP
Welcome guest, is this your first visit? Create Account now to join.
  • Login:

Welcome to the CHIP Forum.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

+ Reply to Thread
Results 1 to 5 of 5

Thread: Fungsi dalam PHP
  
Bookmark and Share

  1. #1
    Join Date
    Aug 2009
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Fungsi dalam PHP



    Apakah ada fungsi dalam PHP yang dapat mengembalikan nilai URL homepage ? Contoh nilai yang diinginkan http://www.abcde.com

    Di Wordpress, kalo gak salah, kira2 fungsinya <?php bloginfo('url'); ?>

    Thanks.

  2. #2
    Join Date
    Jul 2004
    Location
    Jakarta Selatan
    Posts
    6,844
    Thanks
    6
    Thanked 10 Times in 8 Posts
    Rep Power
    90

    Lightbulb Re: Fungsi dalam PHP



    aku coba bantu yah cuman udah lama banget ga maenan PHP neh....

    yang pasti penggunaan double titik bisa mengembalikan ke folder sebelumnya, tapi jika ingin diarahkan ke url tertentu, gunakan header location dan untuk sintak penulisan header location itu gimana, agar2 lupa juga, maklum udah lama banget

    bisa kau baca dengan jelas disini mungkin..

    LINK : http://php.net/manual/en/function.header.php

    semoga tercerahkan.

    regards
    yossie3660

  3. #3
    Join Date
    Feb 2006
    Location
    Joglo @ border of Jk-Bar & Jak-sel
    Posts
    2,441
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    20

    Re: Fungsi dalam PHP



    Quote Originally Posted by denisprasetio View Post
    Apakah ada fungsi dalam PHP yang dapat mengembalikan nilai URL homepage ? Contoh nilai yang diinginkan http://www.abcde.com

    Di Wordpress, kalo gak salah, kira2 fungsinya <?php bloginfo('url'); ?>

    Thanks.
    kalo cuma mau ambil URL current page bisa pake ini:
    Code:
    $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
    3 principles of my life:
    "Leap before you look, buy before you Think"
    "Don't beg for it, earn it. Then it will be granted to you!!"
    "Grade isn't everything"

  4. #4
    Join Date
    Aug 2009
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: Fungsi dalam PHP



    Yang mau diambil bukan current page, tetapi address domainnya.
    Misalkan coding tsb ada di situs http://www.abcde.com, maka saya mau fungsi tsb memberikan nilai http://www.abcde.com

    Thanks.

    Quote Originally Posted by ShinnAsuka View Post
    kalo cuma mau ambil URL current page bisa pake ini:
    Code:
    $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];

  5. #5
    Join Date
    Jan 2007
    Location
    Bogor
    Posts
    212
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    10

    Re: Fungsi dalam PHP



    Kalo gitu tinggal di edit lagi aja bro, code dari ShinnAsuka.

    Code:
    <?php 
    $url = parse_url('http://www.' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']); 
    echo $url[scheme] . '://' . $url[host]; 
    ?>
    Tuk lebih jelas bisa googling "parse_url"
    Last edited by rizza; 21-03-2010 at 14:46.


 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts