Location: PHPKode > projects > web-cp - Web Hosting Control Panel > webcp/web/setup_config.php
<?
// If data is set (i.e the submit button has been hit)
if (isset($data)) {
	if (is_array($data)) {
		$data['os'] = explode('/', $data['os']);
		$data['osversion'] = $data['os'][1];
		$data['os'] = $data['os'][0];

		$config = '';
		foreach ($data AS $key => $val) {
			$config .= urlencode($key).'='.urlencode($val).'&';
		}
		$config = substr($config, 0, -1);
		commit('setup', $config);

		sleep(2);

		send_header('Location: http://'.$cfg['sysname'].':'.$cfg['port']);
	}
}
?>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>web://cp setup script</title>
<meta name="description" content="web://cp setup script">
<style type="text/css">
<!--
/* Body Style */
body	{ font-family: Arial;  font-size:16px; margin: 0; background-color:#F5F5F5; }

/* <a> Links Style */
a	{ text-decoration:underline; 
	  color:#2d2d2d;
	}
a:hover	{ text-decoration:underline; 
	  color:#464646;
	}


/* web://cp use the following classes */

/* Font Style & Types */
.small	{ font-size:11px; }
.normal	{ font-size:16px; }
.big	{ font-size:18px; }

/* Table Style */
.tbltop {background-color: #5B7B9C; color: #f5f5f5; font-size: 17px; font: bold; text-align: right}
.row1 	{ background-color:#e9e9e9; }
.row2	{ background-color:#E2EAF2; }
.tblbg {background-color: #DADADA}

/* PopUp Help Style */
.popup {
	border: solid 1px #666666;
	padding: 1px;
	width: 200;
	background-color: #94B4D1;
	layer-background-color: #94B4D1;
	position: absolute;
	visibility: hidden;
}
-->
</style>
<script language='JavaScript' src='script.js'></script>
</head>
<body><br>
<div id="HTTP Server" class="popup"><b>web://cp HTTP Server</b><br>Select the dedicated HTTP server used for the web://cp control panel.  The default RPM is the bundled php server.</div>
<div id="Database Host" class="popup"><b>Database Host</b><br>The IP or Host Name of the computer that is running the MySQL database.</div>
<div id="Database User" class="popup"><b>Database User</b><br>The user that will be used to log into the Database Host</div>
<div id="Database Password" class="popup"><b>Database Password</b><br>The password that will be used to log into the Database Host. Can be left empty for no password.</div>
<div id="Database Name" class="popup"><b>Database Name</b><br>The name of the Database that web://cp tables will be imported into.</div>

<div id="Server Domain" class="popup"><b>Server Domain</b><br>The domain that will resolve to the server running web://cp. If DNS isn't set up yet it could also be in the form of an IP address.</div>
<div id="Admin E-Mail" class="popup"><b>Admin E-Mail</b><br>Email address that can be used to contact the system administrator.</div>
<div id="Operating System" class="popup"><b>Operating System</b><br>The operating system that web://cp is running on.</div>
<div id="Default Language" class="popup"><b>Default Language</b><br>The language that will be set for all users until they change their language setting.</div>
<div id="Secret Key" class="popup"><b>Secret Key</b><br>A string of characters that should be kept secret. It will be used for encryption and verification.</div>

<div align='center'><big>web://cp setup script</big></div><br>

<?
// include needed files if necessary
if ($cfg['httpd_mode'] != 'webcp') {
	$tmp = "config.inc.php";
	include($tmp);
	$tmp = "functions.inc.phps";
	include($tmp);
}

// load default language
include("lang/".$cfg['defaultlang'].".phps");

$current_url = 'setup_config.php';

// reload default language
include("lang/".$cfg['defaultlang'].".phps");

// load and parse default skin
include("parser.inc.phps");

?>
<br>
<form action="<?=$current_url;?>" method="post" name="webcp" onSubmit="submitonce(this);">
<!-- DATABASE CREATION -->
<div align="center">
<table border="0" cellpadding="0" cellspacing="0"><tr><td>
<table border="0" cellpadding="0" cellspacing="0" class="tblbg"><tr><td>
<table border="0" cellspacing="1">
	<tr>
		<td colspan="3" class="tbltop">&nbsp;Database Configuration&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;Database Host&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="text" name="data[dbhost]" size="25" maxlength="255" value="<?=(isset($data['dbhost'])?$data['dbhost']:'localhost');?>">&nbsp;</td>
		<td class="row2"><img src="/icon/question.png" width="24" height="24" onmouseover="popup(event,'Database Host')" onmouseout="popup(event,'Database Host')"></td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;Database User&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="text" name="data[dbuser]" size="25" maxlength="255" value="<?=(isset($data['dbuser'])?$data['dbuser']:'root');?>">&nbsp;</td>
		<td class="row2"><img src="/icon/question.png" width="24" height="24" onmouseover="popup(event,'Database User')" onmouseout="popup(event,'Database User')"></td>

	</tr>
	<tr>
		<td class="row1"><b>&nbsp;Database Password&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="text" name="data[dbpass]" size="25" maxlength="255" value="<?=$data['dbpass'];?>">&nbsp;</td>
		<td class="row2"><img src="/icon/question.png" width="24" height="24" onmouseover="popup(event,'Database Password')" onmouseout="popup(event,'Database Password')"></td>

	</tr>
	<tr>
		<td class="row1"><b>&nbsp;Database Name&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="text" name="data[dbname]" size="25" maxlength="255" value="<?=(isset($data['dbname'])?$data['dbname']:'webcp');?>">&nbsp;</td>
		<td class="row2"><img src="/icon/question.png" width="24" height="24" onmouseover="popup(event,'Database Name')" onmouseout="popup(event,'Database Name')"></td>
	</tr>
</table>
</td></tr></table><br>

</td></tr></table>
</div>

<!-- DATABASE CREATION -->
<div align="center">
<table border="0" cellpadding="0" cellspacing="0"><tr><td>
<table border="0" cellpadding="0" cellspacing="0" class="tblbg"><tr><td>
<table border="0" cellspacing="1">
	<tr>
		<td colspan="3" class="tbltop">&nbsp;Server Configuration&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;web://cp HTTP Server&nbsp;</b></td>
		<td class="row2">&nbsp;<select name="data[httpd_mode]">
									<option value="apache"> Dedicated Apache server</option>
                       				<option value="webcp"<?=(($data['httpd_mode'] == 'webcp')?' selected':'');?>> Bundled php server</option>
                       			</select>&nbsp;</td>
		<td class="row2"><img src="/icon/question.png" width="24" height="24" onmouseover="popup(event,'HTTP Server')" onmouseout="popup(event,'Database Host')"></td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;Server Domain&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="text" name="data[sysname]" size="25" maxlength="255" value="<?=$data['sysname'];?>">&nbsp;</td>
		<td class="row2"><img src="/icon/question.png" width="24" height="24" onmouseover="popup(event,'Server Domain')" onmouseout="popup(event,'Server Domain')"></td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;Admin E-Mail&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="text" name="data[adminmail]" size="25" maxlength="255" value="<?=$data['adminmail'];?>">&nbsp;</td>
		<td class="row2"><img src="/icon/question.png" width="24" height="24" onmouseover="popup(event,'Admin E-Mail')" onmouseout="popup(event,'Admin E-Mail')"></td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;Operating System&nbsp;</b></td>
		<td class="row2">&nbsp;<select name="data[os]">
			<option value="freebsd/4"> FreeBSD - 4.0+</option>
			<option value="linux/RedHat9.0">Linux - Red Hat 9.0+</option>
			<option value="linux/RedHat7.0">Linux - Red Hat 7.0+</option>
			<option value="linux/RedHat6.2">Linux - Red Hat 6.2</option>
		</select>&nbsp;</td>
		<td class="row2"><img src="/icon/question.png" width="24" height="24" onmouseover="popup(event,'Operating System')" onmouseout="popup(event,'Operating System')"></td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;Default Language&nbsp;</b></td>
		<td class="row2">&nbsp;<select name="data[defaultlang]">
			<option value="danish">Danish</option>
			<option value="english" selected>English</option>
			<option value="french">French</option>
			<option value="german">German</option>
			<option value="norwegian">Norwegian</option>
			<option value="russian">Russian</option>
			<option value="spanish">Spanish</option>
			<option value="swedish">Swedish</option>
		</select>&nbsp;</td>
		<td class="row2"><img src="/icon/question.png" width="24" height="24" onmouseover="popup(event,'Default Language')" onmouseout="popup(event,'Default Language')"></td>

	</tr>
	<tr>
		<td class="row1"><b>&nbsp;Secret Key&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="text" name="data[key]" size="25" maxlength="255" value="<?=$data['key'];?>">&nbsp;</td>
		<td class="row2"><img src="/icon/question.png" width="24" height="24" onmouseover="popup(event,'Secret Key')" onmouseout="popup(event,'Secret Key')"></td>
	</tr>
</table>
</td></tr></table><br>

<div align="right"><input type="submit" value="Submit"></div>

</td></tr></table>
</div>

</form>
</body>
</html>
Return current item: web-cp - Web Hosting Control Panel