What I am trying to do:
Example:
Page1 http://www.smartmindmedia.com/jokes/index.html
has a link to
http://www.smartmindmedia.com/jokes/ind ... d=test.txt
Click the "test link"
So now your at page
http://www.smartmindmedia.com/jokes/ind ... d=test.txt
In the main section of this page where it says DISPLAY HERE
I want to have the info in the test.txt to display.
would I use
<? echo [http://www.smartmindmedia.com/jokes/"$id"] ?>
This test.txt file is in the directory:
http://www.smartmindmedia.com/jokes/
I really have no idea what I am doing as far as PHP goes, but it seems simple enough so I'm trying to figure it out.
pulling info from a text file
Moderator: General Moderators
- evilmonkey
- Forum Regular
- Posts: 823
- Joined: Sun Oct 06, 2002 1:24 pm
- Location: Toronto, Canada
Uhh, no. You'd have to open the file using [php_man]fopen[/php_man], and read it using [php_man]fread()[/php_man].
You can alternativly use [php_man]file_get_contents()[/php_man] to read your text file, it apparently works better.
Then you can echo $contents.PHP Manual wrote:$filename = "/usr/local/something.txt";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
You can alternativly use [php_man]file_get_contents()[/php_man] to read your text file, it apparently works better.