importing text to site

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
deadroad503
Forum Newbie
Posts: 3
Joined: Tue Apr 21, 2009 4:11 am

importing text to site

Post by deadroad503 »

i cant seem to find any other resource for this other than php and im not familiar with it. i want to be able to take a txt file that a friend uploads to their site and dynamically import it to my site when ever they update it. it also needs to have the css format of my site when it imports? the only ways i can think of this is php or sql and my experience says sql is exteremely messy when it comes to this. is php any better? if so can someone please help with the coding? thanks
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: importing text to site

Post by Christopher »

PHP and SQL are very different. You can use a PHP function like file_get_contents() to read your friends file.
(#10850)
deadroad503
Forum Newbie
Posts: 3
Joined: Tue Apr 21, 2009 4:11 am

Re: importing text to site

Post by deadroad503 »

i admit i dont know much about php. could someone post an example that i might be able to reference and get started with? thanks
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: importing text to site

Post by Christopher »

The manual is full of examples, plus use supplies comments and examples at the bottom of each page:

http://us.php.net/manual/en/function.fi ... ntents.php
(#10850)
deadroad503
Forum Newbie
Posts: 3
Joined: Tue Apr 21, 2009 4:11 am

Re: importing text to site

Post by deadroad503 »

kk thanks ill post a reply if i have any trouble with it.
Post Reply