Jump to content

Global Terms Page (An echo, include and variable Nightmare) Help!!!


Recommended Posts

So, I've got a large number of websites and I want to use a generic/global Terms and Conditions page for all of them. Updating this Terms Page on each site now is a nightmare.

 

So, I've got the Terms Page set up on one of those websites and plan to use something like this on www.mysite2.com/terms.php:

 

<?php include 'http://www.mysite1.com/incs/terms.php' ?>

 

I've successfully done this with all my Privacy Policy pages.

 

Here's the catch, the Privacy Policy stays the same across all sites 100% of the time, so a simple include works fine.

 

But with the Terms Page; they read, ".... your use of MySite2.com (the "website") ...." blah blah blah.

 

So I want to include something like this:

 

<p> Your Use of <?php echo $sitename; ?> (the "website') .... </p>

 

WRAP UP: I have a "Global Terms Page" on ONE website (it's not a full page, just a bunch of text with minimal markup, i.e. <h2><p><ol> etc..... no headers, footers it's an inc file.)This "Global Terms Page" needs to include/print a $variable that is declared from a different site.

 

So you visit Site2's Terms Page, it pulls the content from Site1's Global Terms Page (which has a echo $variable) and then gets displayed on Site2 (which has the $variable declaration) giving you a complete Terms Page on Site2.

 

All Sites are on the same server. I've messed around with echos, includes, functions, globals, fopens and can't get it to work. It just displays the sentence with an extra "space" where the site name should be.

 

Any suggestion? Thanks.

i actually have dealt with the same... i use a config script which is generated on the root server side, and each will exist within it's corosponding site's root directory... from there your should be able to query anything that is stored about the site...

 

for all my sites, i have made a database table holding all the "about us", "privacy", etc...

 

let me know if i can help you further...

This is easy if all sites are on the same server. Store the terms content in a text file somewhere on your server i.e. /usr/local/php/includes/terms.txt

 

In the text file use a tag where you will want to replace text on each site i.e.

// terms.txt
<p>Your use of [sITENAME] etc......</p>

 

Then on each site get the contents of the file and use the str_replace function to replace the markers. If you have multiple markers use an array as parameters in the function i.e.

<?php
$terms = file_get_contents('/usr/local/php/includes/terms.txt');
$terms = str_replace("[sITENAME]", "mysite.com", $terms);

print $terms;
?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.