|
PCCS MySQLDatabase Admin Tool version 1.3.4
|
/ -> mysqldb_create_dbincludescript.php
1
2 <?php
3 /************************************************************************
4 PCCS MySQLDatabase Admin Tool
5 Copyright (C) Chauncey Thorn
6
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA , USA.
20 **************************************************************************/
21 /////////////////////////////////////////////////////////////////////////////// 22 // Create Database include file 23 // User ID Password and connection functions 24 // no need to modify unless you like hacking 25 // bugs report to cthorn 26 /////////////////////////////////////////////////////////////////////////////// 27
28 $dbinclude_filename="dbinclude.php";
29
30 $dbinclude = fopen($appfiledir . $dbinclude_filename,"w");
31 fputs($dbinclude,"<?php\n//** Generated by PCCS-MyAppGen $today\n");
32 fputs($dbinclude,"/////////////////////////////////////////////////////////////////////////////////////\n");
33 fputs($dbinclude,"// coder: cthorn\n");
34 fputs($dbinclude,"////////////////////////////////////////////////////////////////////////////\n");
35 fputs($dbinclude,"\$db_server = \"localhost\";\n");
36 fputs($dbinclude,"\$db_user =\"$userid\";\n");
37 fputs($dbinclude,"\$db_passwd = \"$pw1\";\n");
38 fputs($dbinclude,"\$db_name = \"$webdatabase\";\n");
39 fputs($dbinclude,"//\n");
40 fputs($dbinclude,"\$dbhandle = mysql_connect(\"\$db_server\",\"\$db_user\",\"\$db_passwd\") or die(mysql_error());\n");
41 fputs($dbinclude,"mysql_select_db(\$db_name, \$dbhandle);\n");
42 if($news_system = "Y") {
43 fputs($dbinclude,"/* Default Colors */\n");
44 fputs($dbinclude,"\$bgcolor = \"006666\";\n");
45 fputs($dbinclude,"\$bgtext = \"000066\";\n");
46 fputs($dbinclude,"\$tcolor = \"000077\";\n");
47 fputs($dbinclude,"\$ttext = \"ffffff\";\n");
48 fputs($dbinclude,"\$fcolor = \"bbbbbb\";\n");
49 fputs($dbinclude,"\$ftext = \"000000\";\n");
50 fputs($dbinclude,"\$link = \"000099\";\n");
51 }
52
53 fputs($dbinclude,"//\n");
54 fputs($dbinclude,"//\n");
55 fputs($dbinclude,"//////////////////////////////////////////////////////////////////////////\n");
56 fputs($dbinclude,"?>\n");
57 fclose($dbinclude);
58
59 ?>
| |