GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   How to pull your URL into an Include? (https://gfy.com/showthread.php?t=979603)

crazytrini85 07-26-2010 01:33 AM

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 07-26-2010 05:25 AM

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)

fris 07-26-2010 05:32 AM

not really wise to allow it for a server if you share it, but if its just your box, im pretty sure its ok

woj 07-26-2010 07:46 AM

it's bad idea, use full path instead:
include('/home/bluh/bluh/footer.php');

crazytrini85 07-26-2010 07:51 AM

Quote:

Originally Posted by woj (Post 17363537)
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.

woj 07-26-2010 08:09 AM

Quote:

Originally Posted by crazytrini85 (Post 17363545)
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...


All times are GMT -7. The time now is 02:31 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123