War Room

Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk

Featured Warrior Special Offer...
"Members Of The *War Room* Discover Secrets To Immediate Success!"
Reply
 
LinkBack Thread Tools
Old 12-22-2008, 10:38 AM   #1
Brainstorming Wizard
War Room Member
 
George Sepich's Avatar
 
Join Date: Mar 2004
Posts: 4,732
Thanks: 0
Thanked 34 Times in 23 Posts
Social Networking View Member's Twitter Profile 
Contact Info
Send a message via Skype™ to George Sepich
Default PHP Config File Mod Help

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
George Sepich is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-22-2008, 11:35 AM   #2
PHP & Drupal Ninja
 
Darren Mothersele's Avatar
 
Join Date: May 2007
Location: London, United Kingdom.
Posts: 105
Thanks: 11
Thanked 15 Times in 12 Posts
Social Networking View Member's Twitter Profile 
Contact Info
Send a message via AIM to Darren Mothersele Send a message via Skype™ to Darren Mothersele
Default Re: PHP Config File Mod Help

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.

Darren Mothersele is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk

Tags
config, file, mod, php

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 05:33 AM.