Reputation: 3840
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
Upvotes: 6
Views: 26765
Reputation: 1507
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.
Upvotes: 8
Reputation: 96266
If you just want to directly output the file, use readfile.
Upvotes: 3