Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function create_config($post_details)
- {
- $fp = fopen('../includes/config.php', 'w');
- if ($fp)
- {
- $content = "<?php \n" .
- " \n" .
- "/* Database Host Name */ \n" .
- "\$db_host = '" . $post_details['db_host'] . "'; \n".
- " \n" .
- "/* Database Username */ \n" .
- "\$db_username = '" . $post_details['db_username'] . "'; \n" .
- " \n" .
- "/* Database Login Password */ \n" .
- "\$db_password = '" . $post_details['db_password'] . "'; \n" .
- " \n" .
- "/* Database and Session prefixes */ \n" .
- "define('DB_PREFIX', '" . $post_details['table_prefix'] . "'); ## Do not edit ! \n" .
- "define('SESSION_PREFIX', 'probid_'); \n" .
- " \n" .
- "/* Database Name */ \n" .
- "\$db_name = '" . $post_details['db_name'] . "'; \n" .
- "?>";
- fputs($fp, $content);
- fclose($fp);
- $output['display'] = '<b>The configuration file was created successfully.</b>';
- $output['result'] = true;
- }
- else
- {
- $output['display'] = '<b>Error: Could not create the configuration file.</b><br> '.
- 'Please make sure the <b>includes</b> folder has writing permissions and the <b>config.php</b> file doesn\'t already exist.';
- $output['result'] = false;
- }
- return $output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement