Jump to content


Photo

Php Important Help Needed - Help Please


  • Please log in to reply
8 replies to this topic

#1 coolme52

coolme52
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 20 August 2006 - 03:24 PM

i am building a script

i wanna give a feature so that the user can select the feature direct from admin panel so noo need to open the config file and edit it as it can directly be done from admin panel

can some 1 plz tell me how i can do this


#2 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 20 August 2006 - 03:28 PM

Store the settings in a database, or make the admin panel edit the config file.

#3 coolme52

coolme52
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 20 August 2006 - 03:30 PM

in a config file

for eg config.php

can u post a code example to do it


#4 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 20 August 2006 - 03:30 PM

If I read your post correctly, what you are asking for can be already done from the admin panel (you wrote?) so why not use the same code to let the user change it - although the concept of any user messing with a configuration variable sounds dangerous.

If I've misinterpreted your post, explain the problem in more detail.

Edit:

can u post a code example to do it


No, that wouldn't be a helpful exercise since you have all the relevant information anyone would use to 'post a code example'.  The online manual has many examples of how to read a file and write to a file.  Why don't you try, and if you're unsuccessful then post your code here for help.
Legend has it that reading the manual never killed anyone.
My site

#5 coolme52

coolme52
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 20 August 2006 - 03:33 PM

Ill Explain My Question

For Eg

i have a file name settings.php

in that i put a code

$sitename = "My Site Name"

now if the script user wants to change the site name he has to open config.php and edit it

but wat i want is an option in admin panel where it says

Enter Your Site Name :

And wat ever u enter there is saved in the config

i hope u got me now



#6 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 20 August 2006 - 03:36 PM

http://codewalkers.c...rials/57/1.html

Read that. It has all the information you need to start.
Legend has it that reading the manual never killed anyone.
My site

#7 coolme52

coolme52
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 20 August 2006 - 03:39 PM

do u mean i should rewrite the settings.php everytime settings are changed ???

#8 coolme52

coolme52
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 20 August 2006 - 09:45 PM

help me plz

#9 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 20 August 2006 - 11:30 PM

do u mean i should rewrite the settings.php everytime settings are changed ???


How else would the right values be read?

In the manual, look at the file open, file read, file write commands.
Legend has it that reading the manual never killed anyone.
My site




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users