Authorising external Domains to embed my content - embed

I am looking for code to insert into a php file i.e. webfile.php (the content of this file is just basic html content), that will authorise/give selected domains the ability to embed this file. I was considering the external domains call the page via <?php echo file_get_contents('webaddress/webfile.php'); ?>

Related

HTML / CSS - How do I embed external fonts (files) into an html page without referencing as a separate file?

I have a template used for an email that I originally have linked to external font files in my testing environment.
This email template relies upon custom fonts which I want to load into an email html page. Initially I load them into the file using a file link.
However, when I use this in an email, I will not be able to refer to the external file.
Is it possible to embed the font file into the html page without relying on loading it as a separate file from css, preferable without using a public link on the web?

Default HTML Page?

Alright, I don't know how exactly I'm going to phrase this, so bear with me here. Is there a way to set a default HTML page? Like is there a line of code that I can use on new html files to load a local .html file for almost a template?
Use any sever-side programming language to include header and footer parts of your default webpage.
Example on PHP:
<?php
echo file_get_contents("header.html")
?>
Your page contents
<?php
echo file_get_contents("footer.html")
?>
You can set default html page in your webserver. But that's just if someone hits http://server/ with no page name it tells what page to use like http://server/index.html versus http://server/default.apx, etc. Has nothing to do with templates.
If you want to be able to include html files inside other html files, you probably need a serverside language like ASP, PHP, JSP. HTML itself doesn't have that capability, although some webservers might offer a custom tag that is translated on server-side for includes.
The default web page on a server must have the name index.html, index.htm or sometimes default.htm. It is possible to change the server to accept other file names as default files, but those are the most commonly used ones. What is the index.html page?
If you're asking how to make your web browser open a default page when you open it, this is usually called the "Home Page" and any file or page that you can visit in your browser you can assign as the home page.
If you're trying to create a template for a web page, there are many ways to do it. The PHP example listed above is one way. You can also do it with JavaScript. Write your HTML in document.write() calls inside a file named navigation.js and then place this script where you want that code displayed:
<script type="text/javascript" src="navigation.js"> </script>
However, this is not unobtrusive and could cause problems. Another way to do it is with Server Side Includes. Write a file named navigation.ssi and then add the following SSI line to your HTML where you want the included file to display:
<!--#include virtual="/ssi/navigation.ssi" -->
You can also do it with ASP and other methods. I explain in more detail in my article How Do I Include One HTML File in Another?

Where is joomla main page

Web sites built by the simple way often have a main html document that the html code is written in it.
If a user right clicks on the browser and select "view page source" then the name : "Example.html" will appear as page source.
That file then can be found in the web site's root directory.
My question is : what about joomla? Where is that main file?
What if I want to put some code in the page that I see on the front end, where do I do that?
Joomla doesn't contain any html files for displaying content, the only html files you will find are blank.
Joomla uses 2 index.php files. There is one in the template folder where all the HTML, CSS and Javascript is pushed to and the other is in the root of your Joomla site where all applications get pushed to one loaded.
When you view the page source code for a Joomla site, you are simply viewing the structure that has been pushed to the index.php file from various locations, such as from modules and components.
Update
Ok, I think this might be best done in the index.php file of your template. First, in the Joomla backend, get the ID of the menu item that link to the page that you wish to use for your code. Once done, add the following code to the index.php:
<?php
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$menu = $app->getMenu()->getActive()->id;
if ( $menu == 1) { // change 1 to the ID that you got from the Menu Manager
$doc->addStyleDeclaration('
//css goes here
');
$doc->addScriptDeclaration('
//javascript code goes here
');
?>
<p>hello world</p>
<?php
}
?>

wordpress: how to add a custom static HTML page template?

is it possible with the dashboard to add custom static HTML files for generating new webpages ?
if not what's the easiest way ?
and how to make sure this pages are categorizable and also referencable on google search engine?
In Your theme directory You ca put some files, and name them like:
page-homepage.php
page-contact.php etc
Now, each of those files needs to open with:
<?php
/*
* Template Name: Contact Page
*/
?>
and this header needs to de diffrent for each file (it gves the termplate a name)
Now put any html You like inside (also consider adding get_header() and get_footer(), so You have all necesary scripts and mockup.
After creating those files, when editing a page in WP You can select the file as template.

Single Html Page without CMS (wordpress)

I have a wordpress website (self hosted blog), but now I need to create a page like http://www.example.com/testpage.html.
How can I do this? How this person has done it? http://lukepeerfly.com/demos/iframe/html.txt
there are few ways to a "landing page" in your site. here's 2 methods:
1 - you can create a page in the cms and then make a template for it.
For example, we wanna make a page named "landing". We duplicate the page.php file in our theme and change his name to landing.php (as described here: http://codex.wordpress.org/images/1/18/Template_Hierarchy.png).
Then, in the page's code, in the top, we'll write the template name in the right syntax:
< ?php
/*
Template Name: landing
*/
?>
//other html/php code here
You can include the header, footer, sidebar, or choose not to include them.
the page url will be www.mysite.com/landing.
2 - The second way is to create a file outside your theme folder, in your server's root directory or in some designated folder (using a ftp connection, ofcourse). in the example you brought, http://lukepeerfly.com/demos/iframe/html.txt, html.txt is probably located in root\demos\iframe directory on the server.
your new file will be outside the wordpress. if you do want the file to be a part of your wordpress system (you need it if you want to use wordpress functions, hooks, database and etc) you'll need to include the "wp-load.php" file in the start of your code.
For example, our page, "landing.php", is directory "pages" in my root directory. in the page's code we'll write the following lines:
<?php
require('./../wp-load.php');
?>
//other html/php code here
In here as well, you can include the header, footer, sidebar, or choose not to include them.
the page url will be www.mysite.com/pages/landing.php.
you can just create the .html file and upload it to your FTP server and then link to it in your wordpress blog.