I am designing a site that will have several variables used on multiple pages and would like to create a settings page that allows an admin to update the value of these variables that are saved in a php file. I was thinking of using fwrite to update the values in the settings php file directly. From what i've read on fwrite it sounds like this is possible but I am wondering if there is a security risk in doing it that way and if so what a more secure solution would be.

Instead of importing variable values from file why don't you import values from database it will be easy to edit their values from admin panel.

Ya i could do that easy enough. I guess it wouldn't really save that much database connection anyway.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.