![]() | | ||||||||
| | #1 |
| TalkMarketingNow.com War Room Member Join Date: Mar 2004 Location: Illinois
Posts: 4,930
Thanks: 9
Thanked 150 Times in 71 Posts
|
I have a simple one line config file... <?php $clickbanknickname = "namegoeshere"; ?> I need some kind of form or admin panel that will allow my customers to easily change the above file (it will be hosted on my server) Is there a way to maybe have them fill out a one field form with their CB nickname, send that to a text file on my server and then "include" that text file in the above config? Thanks, George |
| | |
| | #2 |
| PHP & Drupal Ninja Join Date: May 2007 Location: London, United Kingdom.
Posts: 108
Thanks: 11
Thanked 18 Times in 14 Posts
|
assuming you want them to supply a password in order to change the value. in one file you have code like this: <?php if ($_REQUEST['password'] == 'secret-password-here') { $myFile = "configfilename.inc"; $fh = fopen($myFile, 'w') or die("can't open file"); fwrite($fh, $_REQUEST['cbusername']); fclose($fh); } else { // print a form here with password and cbusername field } ?> In your config file use file_get_contents('configfilename.inc') to read in the value from the config file as a string. This is only a very basic script - you should probably do more validation of user input. |
| | |
| | |
![]() |
|
| Tags |
| config, file, mod, php |
| Thread Tools | |
| |
![]() |