Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i import html with php?

Tags:

php

This is a really simple one but it's driving me crazy.

I want to import regular HTML code with the help of PHP.

<?php get_thefile ?>

Is that correct? And what shall the thefile.php contain to get it right except my HTML content that I want to import of course!

More information

In a category part of a website i want to put a sidebar that will show some information, this can be anything from html to flash. This content will change time to time so insteed of editing 100 pages i want to just edit this file, My php skill is 0,1% and i can't relly find what i shall exactly do, So what i need is

1: The code to place in the page

2: What i shall put in the file before ? and after ? my content that i want to import

The file will be in the same folder on server as the main page, the page is php and it's wordpress

like image 376
Mathias Asberg Avatar asked Nov 20 '11 00:11

Mathias Asberg


1 Answers

I'm not sure what you're trying to accomplish, but if it's external HTML, you could use

<?php echo file_get_contents('http://EXTERNAL_URL'); ?>

again, not fully sure what you're trying to do. i hope this helps.

like image 104
Robert Van Sant Avatar answered Oct 13 '22 00:10

Robert Van Sant