Location: PHPKode > scripts > Linker IMG > linker-img/install/step2.php
<?php


if (!$db_host) $errcode .= "<li>Fill DB HOST field</li>\n";
if (!$db_name) $errcode .= "<li>Fill DB NAME field</li>\n";
if (!$db_user) $errcode .= "<li>Fill DB USER field</li>\n";
if (!$db_pass) $errcode .= "<li>Fill DB PASS field</li>\n";
if (!$db_type) $errcode .= "<li>Fill DB TYPE field</li>\n";
$default_server = "http://". $HTTP_HOST . str_replace("/install/step2.php","",$SCRIPT_NAME);

if (file_exists("../function/{$db_type}.php")) {
include "../function/{$db_type}.php";
}
include ("../function/base_info.php"); 
$db = new DB_Sql($db_host,$db_user,$db_pass,$db_name);
$db->DBconnect();
if (!$db->Connect) $errcode .= "<li>Cannot connect Database</li>\n";
if (!$db->ReSelect) $errcode .= "<li>Incorrct or non exist db name</li>\n";

//=====================================
// Error Code
//=====================================

if ($errcode) {

$table_content = <<<EOF

<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td height="25" colspan="2" bgcolor="#E0E0E0" align="center">	<font size="2" color=red><b>ERROR !!</b></font></td>
</tr>

<tr>
<td height=100><font size=2><b><ul>$errcode</ul></b></td>
</tr>

<tr>
<td height="30" colspan="2" bgcolor="#E0E0E0" valign="bottom" align="center"><font size=2>
<input type="button" value=" << BACK " style="background-color:rgb(255,255,223);" onClick="history.back()"></font></td>
</tr>

</table>

EOF;
}

//=====================================
// Step2 output
//=====================================

else {

// Language Select

$handle = opendir("../lang");
while ($dirname = readdir($handle)){

	if ($dirname <> "." && $dirname <> ".." && is_dir("../lang/$dirname")) {
	$full_path = "lang/" . $dirname;
	if ($full_path == $Slang) 
	$lang_op .= "<option value='$full_path' selected>". ucfirst($dirname) . "</option>\n";
	else
	$lang_op .= "<option value='$full_path'>" . ucfirst($dirname) . "</option>\n";

	}
}
closedir($handle); 

$table_content = <<<EOF

	<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
	<tr>
	<td height="25" colspan="2" bgcolor="#E0E0E0" align="center">	<font size="2"><b>Fill other things</b></font></td>
	</tr>

	<tr><td colspan=2 height=1 bgcolor=gray><img src="image/x1.gif"></td></tr>

	<tr>
	<td width="168" height="25" bgcolor="#F6F6F6" align="center"><font size=2 color="black">&nbsp;Admin ID</font></td>
	<td width="309" bgcolor="#F6F6F6">&nbsp;<input type="text" name="admin_id"></td>
	</tr>

	<tr><td colspan=2 height=1 bgcolor=gray><img src="image/x1.gif"></td></tr>
	
	<tr>
	<td width="168" height="25" bgcolor="#F6F6F6" align="center"><font size=2 color="black">&nbsp;Admin Pass</font></td>
	<td width="309" bgcolor="#F6F6F6">&nbsp;<input type="password" name="admin_pass"></td>
	</tr>

	<tr><td colspan=2 height=1 bgcolor=gray><img src="image/x1.gif"></td></tr>

	<tr>
	<td width="168" height="25" bgcolor="#F6F6F6" align="center"><font size=2 color="black">&nbsp;Admin Email</font></td>
	<td width="309" bgcolor="#F6F6F6">&nbsp;<input type="text" name="admin_email"></td>
	</tr>

	<tr><td colspan=2 height=1 bgcolor=gray><img src="image/x1.gif"></td></tr>	
	
	<tr>
	<td width="168" height="25" bgcolor="#F6F6F6" align="center"><font size=2 color="black">&nbsp;Linker URL</font></td>
	<td width="309" bgcolor="#F6F6F6">&nbsp;<input type="text" name="site_path" value="$default_server" size=20 style="width:250px"></td>
	</tr>

	<tr><td colspan=2 height=1 bgcolor=gray><img src="image/x1.gif"></td></tr>	
	
	<tr>
	<td width="168" height="25" bgcolor="#F6F6F6" align="center"><font size=2 color="black">&nbsp;Language</font></td>
	<td width="309" bgcolor="#F6F6F6">&nbsp;<font size=2><select name="language">$lang_op
	</select></font></td>
	</tr>

	<tr><td colspan=2 height=1 bgcolor=gray><img src="image/x1.gif"></td></tr>
	
	<tr>
	<td height="30" colspan="2" bgcolor="#E0E0E0" valign="bottom" align="center">&nbsp;<font size=2><input type="reset" value=" Reset" style="background-color:rgb(226,226,226);">
	<input type="submit" value=" Next >>" style="background-color:rgb(255,255,223);"></font></td>
	</tr>

	</table>

EOF;

}



print <<<EOF

<html>
<head>
<title>LINKER INSTALL</title>
</head>

<body bgcolor="#F6F6F6" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0">

<form action="step3.php" method="post">
<input type="hidden" name="db_host" value="$db_host">
<input type="hidden" name="db_user" value="$db_user">
<input type="hidden" name="db_pass" value="$db_pass">
<input type="hidden" name="db_name" value="$db_name">
<input type="hidden" name="db_type" value="$db_type">

<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
<tr>
<td height="75" bgcolor="#E0E0E0" align="center"><img src="image/title.gif" border="0"></td>
</tr>

<tr>
<td bgcolor="black"><font color="white" size=2 face="Arial"><b>&nbsp;&nbsp;INSTALL &gt;&gt; STEP 2</b></font></td>
</tr>

<tr>
<td bgcolor="#F6F6F6"  valign=top>

<br><br><br><br>

<table width="500" cellspacing="0" cellpadding="0" border="0" align=center>
<tr>
<td align="left" valign=top width="11"><img src="image/ul.gif" width="11" height="11" border="0"></td>
<td bgcolor="#E0E0E0" width=100%><img src="image/x1.gif"></td>
<td align="right" valign=top width="11"><img src="image/ur.gif" width="11" height="11" border="0"></td>
</tr>

<tr>
<td bgcolor="#E0E0E0" width="11"><img src="image/x1.gif"></td>
<td bgcolor="#E0E0E0">

<!-- Start content -->
$table_content


</td>

<td bgcolor="#E0E0E0" width="11"><img src="image/x1.gif"></td>
</tr>

<tr>
<td align="left" valign=bottom width="11"><img src="image/dl.gif" width="11" height="11" border="0"><img src="image/x1.gif"></td>
<td bgcolor="#E0E0E0"><img src="image/x1.gif"></td>
<td align="right" valign=bottom width="11"><img src="image/dr.gif" width="11" height="11" border="0"><img src="image/x1.gif"></td>
</tr>

</table>


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

</form>
</body></html>

EOF;


?>
Return current item: Linker IMG