Click to See Complete Forum and Search --> : Including stuff
jshalcott
04-13-2006, 01:11 AM
I'm not sure which category this went in so I choice this one.I'm been creating my baseball/softball drills and stuff like that site. Well it has constantly changing stuff on almost each page of the stuff like top news, polls, etc. Here is the link to show you (http://www.jeffatweb.byethost17.com/) . (note: please don't try to do anything, the only thing that works is the link to the story on the top news section, everything else is fake). My question is that is there a way of simply adding some code into it that will include a file, and then be able to just change the content of a file and be done with it. Is there a HTML, Javascript, or PHP. Way of doing this. And please try to explain. :confused:
--------------------------------------------------------------------------
Sorry about that if you could not read this. :)
pcthug
04-13-2006, 01:37 AM
There is a simple PHP function that does just that.
include() (http://www.php.net/include/)
<?php
//This will include a file named example.txt
include 'example.txt';
?>
Then simply save your page with a .php extension
ray326
04-13-2006, 01:14 PM
I have no idea how you were able to read that.
TheBearMay
04-13-2006, 01:26 PM
Or if you don't have PHP and can use Server Side Includes (may have to change the extension to shtml):
<!--#include file="page.txt" -->
BTW - The font in your post is very hard to read, and thus not very friendly
Stephen Philbin
04-13-2006, 02:45 PM
Man that's a bad font. I dunno about you guys, but on my box it looks like it's fresh of a printing press, saturated in about 5 times too much ink! Squidge!
TheBearMay
04-13-2006, 02:57 PM
I know I was wondering if I needed my eyes checked for a bit there. Finally changed the font size to about 300% of the original.
jshalcott
04-15-2006, 01:39 AM
Cool, just one more thing. Is there anyway I can use that code but some how keep my pages html files not php files.
pcthug
04-15-2006, 05:08 AM
Try adding the following to your .htaccess fileAddHandler server-parsed .html
And as for the font... I guess I just must have good eyes ;)