Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Is using text files with includes ok for displaying content on website?
Old 08-12-2008, 06:57 PM Is using text files with includes ok for displaying content on website?
grownupstudent's Avatar
Experienced Talker

Posts: 48
Name: Jono
Location: Ireland
Trades: 0
Hi

I'm just learning how to use includes in PHP and I was doing some stuff today and discovered that instead of converting my text file to a php page and then using includes to display the content I could just leave if as a text file and include it that way, allthough I did notice that different browsers displayed commas incorrectly. I was wondering,

1. Is this bad practice?

2. Safe and secure?

3. Bad for SEO?

Thanks

grownupstudent
grownupstudent is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-12-2008, 09:40 PM Re: Is using text files with includes ok for displaying content on website?
Extreme Talker

Posts: 177
Trades: 0
from what I can find, it's pretty secure.

The only flaw is if you use...

include($variable)

where $variable is a $_GET

otherwise, I think you should be good
kbfirebreather is offline
Reply With Quote
View Public Profile
 
Old 08-12-2008, 10:17 PM Re: Is using text files with includes ok for displaying content on website?
Super Talker

Posts: 130
Trades: 0
I think it should be fine. However, you might also consider using smarty templating. I've found I like it much better than using php includes. You can abstract out your views and also pass variables and put conditional logic.

http://www.smarty.net/
__________________
flann

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
flann is offline
Reply With Quote
View Public Profile
 
Old 08-12-2008, 10:38 PM Re: Is using text files with includes ok for displaying content on website?
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
Quote:
Originally Posted by grownupstudent View Post
Hi

I'm just learning how to use includes in PHP and I was doing some stuff today and discovered that instead of converting my text file to a php page and then using includes to display the content I could just leave if as a text file and include it that way, allthough I did notice that different browsers displayed commas incorrectly. I was wondering,

1. Is this bad practice?

2. Safe and secure?

3. Bad for SEO?

Thanks

grownupstudent
Using PHP is a perfect and easy method of building a template system. As far is the content is concerned, be sure to remember to use standard HTML and use the same text-encoding as your web pages are setup (such as UTF-8)
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 08-13-2008, 03:25 AM Re: Is using text files with includes ok for displaying content on website?
grownupstudent's Avatar
Experienced Talker

Posts: 48
Name: Jono
Location: Ireland
Trades: 0
Thanks guys for the replys much appreciated.
grownupstudent is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Is using text files with includes ok for displaying content on website?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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 1.18535 seconds with 12 queries