Include a txt file in php file
Posted: Fri Feb 15, 2008 6:31 pm
Hey guys and gals,
Article.php?ID=5 accesses the mySQL DB, determines the filename of the text file that ID 5 corresponds to(i.e. Election2008.txt), and then will output it. I don't want to it to go directly to the .txt file because then it won't be formatted. Here is my PHP:
Thanks.
Article.php?ID=5 accesses the mySQL DB, determines the filename of the text file that ID 5 corresponds to(i.e. Election2008.txt), and then will output it. I don't want to it to go directly to the .txt file because then it won't be formatted. Here is my PHP:
Code: Select all
<?
...query code not important...
$file_to_output = mysql_result($result,0,"location");
echo
"<html> <!--formatting codes--!>
[b]Right here is where I want the text to be placed from the textfile $file_to_output[/b]
</html>
";
close();
?>