Wondering how the "pros" do it...

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
Jim
Forum Contributor
Posts: 238
Joined: Fri Apr 19, 2002 5:26 am
Location: Near Austin, Texas

Wondering how the "pros" do it...

Post by Jim »

When talking about forums such as phpBB and Invision Board, I'm wondering how they set up their administration systems.

If you go the admin system of this board, you will find a page that allows you to edit general configuration. For instance -- script paths, database information and stuff like timezone and the like.

This information is also to be found on a text file on the server where the forum is installed.

My question is: Exactly how do they edit these text files with the admin center?

I can't quite grasp how to use strpos() and the like to find text and then edit the information AFTER it. Anywhere I can get sensible help?

Thanks!
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

you might let the script write the complete configuration file, e.g. writing to a temp-file and then moving.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

It's pretty easy if you think about it.

All thoses pages with options are just mysql data that is displayed within input boxes. If you make an update, all the input boxes get sent to the database for an update.

As for anything that has to do with .txt files.

They use the file system functions, such as fopen, fclose, fwrite, and chmod, etc...

If you first look at something trying to graps in your mind how they did it is often a challenge, especialy if your new to scripting php. Don't worry, after a few, you'll get the hang of it. :wink:
Post Reply