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

		if (!isset($data[dbpass_confirm]))
			unset($data[dbpass]);

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

		sleep(2);

		if ($cfg['httpd_mode'] != 'webcp') {
			$tmp = "config.inc.php";
			include($tmp);
		}
	}
} elseif (isset($data) && $userdata['type'] == 'demo') {
	echo "<center>".$T['err']['demo user']."</center>";
}
?>
<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']:$cfg['dbhost']);?>">&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']:$cfg['dbuser']);?>">&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="password" name="data[dbpass]" size="15" maxlength="255">&nbsp;&nbsp;confirm <input type="checkbox" name="data[dbpass_confirm]" value="1"></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']:$cfg['dbname']);?>">&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;Server Domain&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="text" name="data[sysname]" size="25" maxlength="255" value="<?=(isset($data['sysname'])?$data['sysname']:$cfg['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="<?=(isset($data['adminmail'])?$data['adminmail']:$cfg['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 <?=($cfg['os'] == 'freebsd' && $cfg['osversion'] == '4' ? ' selected ' : '')?> value="freebsd/4"> FreeBSD - 4.0+</option>
			<option <?=($cfg['os'] == 'linux' && $cfg['osversion'] == 'RedHat9.0' ? 'selected' : '')?> value="linux/RedHat9.0">Linux - Red Hat 9.0+</option>
			<option <?=($cfg['os'] == 'linux' && ereg('RedHat7\.', $cfg['osversion']) ? 'selected' : '')?> value="linux/RedHat7.0">Linux - Red Hat 7.0+</option>
			<option <?=($cfg['os'] == 'linux' && $cfg['osversion'] == 'RedHat6.2' ? 'selected' : '')?> 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>
<? if ($userdata['type'] != 'demo') { ?>
	<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="<?=(isset($data['key'])?$data['key']:$cfg['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>
Return current item: web-cp - Web Hosting Control Panel