5 replies
  • WEB DESIGN
  • |
Anyone know if it's possible to automatically put the current URL into the page. Say I want a landing page with the domain on it, but don't want to handcraft each page for each domain.
Thanks in advance
#page #putting #url
  • Profile picture of the author aaron_nimocks
    I cant for the life of me post the PHP code for some reason.

    Here is a link if you are using PHP on how to return the current URL. Then you just echo it where you want it.

    PHP Get Current URL
    Signature

    My free PSD logs can be downloaded at PSD Bum. Enjoy!

    {{ DiscussionBoard.errors[1692697].message }}
  • Profile picture of the author Goran Zinic
    if it's html page.. you can use iframes
    Signature
    I will promote your business to my 100,000 members for free. Find out more
    Find out more
    {{ DiscussionBoard.errors[1692707].message }}
  • Profile picture of the author blackjack
    do you mean www.mydomain.com to be shown somewhere on landing page?

    if so then you can use PHP to do that.
    {{ DiscussionBoard.errors[1692727].message }}
  • Profile picture of the author Aaron Sustar
    I always use this simple code snippet for that:

    $full_url = "http". ($_SERVER['HTTPS'] ? "s" : null) . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

    Hope this helps.
    {{ DiscussionBoard.errors[1692897].message }}
  • Profile picture of the author mattalways
    $current_url = $_SERVER['PHP_SELF'];
    $domain = $_SERVER['HTTP_HOST'];
    $queryString = $_SERVER['QUERY_STRING'];

    $url = "http://" . $domain . $current_url . "?" . $queryString;
    Signature

    Quit wasting your money! If you need a website, get me to do it right! I'll probably even do it for less! Design/Development/Software, I'm your guy! matt@snidge.com
    {{ DiscussionBoard.errors[1694428].message }}

Trending Topics