Reply
Including data from text file
Old 03-22-2006, 01:28 AM Including data from text file
Skilled Talker

Posts: 67
Location: Erin, NY
I need help.

I want the data in a text file to appear on the page where I include it. How do I go about doing it?
ltcjohnson is offline
Reply With Quote
View Public Profile Visit ltcjohnson's homepage!
 
When You Register, These Ads Go Away!
Old 03-22-2006, 02:40 AM Re: Including data from text file
stOx's Avatar
Machine

Latest Blog Post:
Worlds Smallest Car - Peel P50
Posts: 2,114
Name: Matt. (>',')>
Location: London, England.
I'm assuming with php..
PHP Code:
<?php
$data 
file_get_contents("textfile.txt");
echo 
"$data";
?>
stOx is offline
Reply With Quote
View Public Profile Visit stOx's homepage!
 
Old 03-24-2006, 12:29 AM Re: Including data from text file
Super Talker

Posts: 144
Code:
<?
 
if ($f = fopen("/path/to/file.txt", "r")) {
  $file_data = "";
 
 while (!feof($f))
   $file_data .= fgets($f, 4096);           
 
 fclose($f);
}
 
echo $file_data;
?>
__________________
create.vibe
web development portfolio
createvibe.com is offline
Reply With Quote
View Public Profile Visit createvibe.com's homepage!
 
Old 03-24-2006, 01:30 PM Re: Including data from text file
Skilled Talker

Posts: 67
Location: Erin, NY
well i figured it out

Code:
<?php include('data.txt') ?>
that there does just what I want it to do.
ltcjohnson is offline
Reply With Quote
View Public Profile Visit ltcjohnson's homepage!
 
Reply     « Reply to Including data from text file
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11204 seconds with 12 queries