How to pull your URL into an Include?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • crazytrini85
    Confirmed User
    • Jun 2006
    • 817

    #1

    How to pull your URL into an Include?

    I can do the date, time, IP address and all of that but have never been able to pull my URL into it.

    Example, in my generic footer include I call the date and then the copyright info, but would also like to add the domain to it so I could have a totally generic footer include that I can drag and drop into any site.

    Thanks ya.
  • HomerSimpson
    Too lazy to set a custom title
    • Sep 2005
    • 13826

    #2
    If you want just to show your site's url just use
    Code:
    echo $_SERVER['SERVER_NAME'];
    but I'm not sure if I got you right: if you want to pull content from other site into your footer

    PHP Code:
    <?php include('http://www.yoursite.com/site.php');?>
    but if your site is not allowing remote includes you should add this to the .htaccess
    PHP Code:
    allow_url_include 1 
    
    or, if you prefer
    PHP Code:
    allow_url_include on 
    
    if that is prohibited by your hosting provider, you should use cURL
    (you can contact me and I can write that for you)
    Last edited by HomerSimpson; 07-26-2010, 04:32 AM.
    Make a bank with Chaturbate - the best selling webcam program
    Ads that can't be block with AdBlockers !!! /// Best paying popup program (Bitcoin payouts) !!!

    PHP, MySql, Smarty, CodeIgniter, Laravel, WordPress, NATS... fixing stuff, server migrations & optimizations... My ICQ: 27429884 | Email:

    Comment

    • fris
      Too lazy to set a custom title
      • Aug 2002
      • 55679

      #3
      not really wise to allow it for a server if you share it, but if its just your box, im pretty sure its ok
      Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

      Comment

      • woj
        <&(©¿©)&>
        • Jul 2002
        • 47882

        #4
        it's bad idea, use full path instead:
        include('/home/bluh/bluh/footer.php');
        Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
        Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
        Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager

        Comment

        • crazytrini85
          Confirmed User
          • Jun 2006
          • 817

          #5
          Originally posted by woj
          it's bad idea, use full path instead:
          include('/home/bluh/bluh/footer.php');
          Why is it bad idea for not using full path? I've always used relative paths. Am I asking for trouble?


          And thanks to the first poster, it is "echo $_SERVER['SERVER_NAME'];" I was looking for.

          Comment

          • woj
            <&(©¿©)&>
            • Jul 2002
            • 47882

            #6
            Originally posted by crazytrini85
            Why is it bad idea for not using full path? I've always used relative paths. Am I asking for trouble?


            And thanks to the first poster, it is "echo $_SERVER['SERVER_NAME'];" I was looking for.
            I meant instead of a url, relative path is fine too...
            Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
            Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
            Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager

            Comment

            Working...