Jump to content

Archived

This topic is now archived and is closed to further replies.

Cell0518

Form -> Config.php

Recommended Posts

Can a PHP form write information to a config.php file, or is there a special extension?

Thanks,
Chris

Share this post


Link to post
Share on other sites
Yes php can write/create and delete files on the server. You'll want to look at the following functions if you want to write something to file:
- [a href=\"http://uk2.php.net/manual/en/function.fopen.php\" target=\"_blank\"]fopen[/a] - open a file
- [a href=\"http://uk2.php.net/manual/en/function.fread.php\" target=\"_blank\"]fread[/a] - read contents of a file
- [a href=\"http://uk2.php.net/manual/en/function.fwrite.php\" target=\"_blank\"]fwrite[/a] - write contents to file

For a quick example of how to write data to a file check out the example for fwrite function (linked above)

In order for these functions to function well make sure the file(s) have the correct CHMOD permissions (you can set these in an FTP client).

Share this post


Link to post
Share on other sites
Thanks for the quick reply. I know that's probably an "over asked" question, but I just couldn't seem to locate an answer. I guess I wasn't generalizing enough. (is that spelled right? [img src=\"http://www.phpfreaks.com/forums/style_images/1/folder_post_icons/icon1.gif\" border=\"0\" alt=\"IPB Image\" /] ) I'll take a look into it.

Thanks again,
Chris

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.