Jump to content

creating an install script


scar5308

Recommended Posts

OK, so trying to run before I can walk again but I learn better this way!

I have a script that requires the path to a folder to be inserted on this line: [code] $config->dir    = "/home/site/public_html/folder/lang_sets/";[/code] where lang_sets is the folder name.
I want to create an install script (install.php) that asks the user to input the path or can auto detect it. I also need to make the script create an array of languages the user wants to use from a dropdown list - language names and id; en, fr, de etc.These values are then written to config.php.

config.php:
[code]#this sets the root path to the language files
  class object {};
  $config = new object;
  $config->dir    = "/home/site/public_html/folder/lang_sets/";
  session_start();
 
  # Create language array
  $language = array("en" => "English", "de" => "German", "lv" => "Latvian", "ru" => "Russian");[/code]

config.php is then included in all the page files.

There is slightly more to it than this but getting an idea of how to do this will certainly help me with the rest.
I haven't had much luck in trying to work this out for myself so I hope someone can help.
Cheers
Simon
Link to comment
https://forums.phpfreaks.com/topic/28536-creating-an-install-script/
Share on other sites

Archived

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

×
×
  • Create New...

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.