Jump to content


External Text Data


3 replies to this topic

#1 Ignatheos

    Young Padawan

  • Members
  • Pip
  • 2 posts

Posted 28 May 2007 - 03:55 AM

Hi, I come here to all you gurus, to search help.

I would like to know how to make a web-page get is text from a external file, is it possible?
Does it need a script, wich language is best?

Thank you.
Ignatheos

#2 Av-

    I Feel Left Out

  • Members
  • PipPipPipPip
  • 1,971 posts
  • Gender:Male
  • Location:10 ft. below sea level

Posted 28 May 2007 - 04:20 AM

imo, the easiest way to load plain external data is by using file_get_contents

$foo = file_get_contents('path/to/text_file.txt');
print($foo);


#3 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 970 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 28 May 2007 - 12:31 PM

He's using PHP just for your information.
(He did ask what language too, Av.)

#4 U1

    Young Padawan

  • Members
  • Pip
  • 245 posts

Posted 28 May 2007 - 02:12 PM

You could also do it with ajax, something like calling this javascript function:

ajax_loadContent('sampletext','external/externalfile.xxx);

Then just load the content with somehting like this in your html page:

<DIV id="sampletext"></DIV>






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users