Should I Use PHP?

jasgor9

New Member
Messages
40
Reaction score
0
Points
0
I am putting an 'updates' area on each page of my new design. I want to be able to edit this, but doing it in HTML would mean that when i edit it, i will have to edit every page. I thought of using PHP includes, but that makes loading slow. Is there another way to do this?
 

Hazirak

New Member
Messages
197
Reaction score
0
Points
0
Unless you feel like getting into using PHP to edit the actual content inside each file, I can't think of any other method besides PHP includes. Of course, you run the very real risk of accidentally messing up the files with your script if you choose the former, so I would strongly suggest backing up the pages you'll be editing if you go for it.

Off the top of my head, the two main functions you'll be interested in will be fopen() and fwrite(). Unfortunately I can't offer much more than that, because I never actually tried to do what you're looking to do... but there is a list of PHP filesystem functions out there if you'd like to seriously look into it.
 
Last edited:

MaestroFX1

Community Advocate
Community Support
Messages
1,577
Reaction score
60
Points
0
If you want to use PHP, then use some CMS.
It would at least make your job easy and security will be decent.
*PHP is just a wildest of wild beast, so take security into prior consideration,
else due to injection, your website may become spoofing and spamming.
 

deadimp

New Member
Messages
249
Reaction score
0
Points
0
I thought of using PHP includes, but that makes loading slow.
How does this make it slow? It might seem that way since the pages aren't cached due to the header output by PHP, but I doubt you'd actually be able to notice a difference in speed if you disabled caching in your static HTML pages.

If you aren't interested in learning that much and just want to have something work 'right out of the box', using a CMS as MaestroFX1 said would be a good option for you.
If you do want to learn, just start searching out some tutorials for yourself on the basics of language, etc, and it should take off from there.
 
Last edited:

Sohail

Active Member
Messages
3,055
Reaction score
0
Points
36
Yeah, Joomla is one to think about, it's open source, easy to use, professional and everything. It's really nice software to use :).
 

rosgar

New Member
Messages
47
Reaction score
0
Points
0
If you want to learn PHP and how these scripts interact, why not test it first to your local computer. If you're using Mac, there's a free emulator like MAMP, you can also use XAMMP for this. For window's I use XAMMP. You can also test different CMS.
 

sunils

New Member
Messages
2,266
Reaction score
0
Points
0
Certainly you can go for a CMS for editing your content any time on the fly.
 

shaiaqua

New Member
Messages
17
Reaction score
0
Points
0
Simply put
PHP:
<?php include("updates.html"); ?>
wherever you want the updates thing to appear. Change updates.html to whatever page you have it on. It will display the contents of updates.html where you put the code, and you only need to change that one file to change the entire site.
 
Top