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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.