Location: PHPKode > projects > CoreAsset > coreasset/initial.php
<?php
	require 'libs/Smarty.class.php';
	
	session_start();
	$fname="status.txt";
	$fp=fopen($fname,"r");
	if($fp)
	 {
	  $stat=fgets($fp);
	  //echo $stat;
	  if($stat=="true")
	       	echo "<script language='Javascript'>location='index.php';</script>";
	}
	$smarty = new Smarty;
	$smarty->compile_check = true;
	$smarty->debugging = false;
	$title	  ="::: Initial Installation :::";
	$smarty->assign('title',$title);
	// Date & Time to be dispalyed on the header 
$date_time	= date("h:i:s A")." ".date("d-m-Y");
$smarty->assign('date_time',$date_time);
// Done
	// Saving in Sesion
	
	foreach($_REQUEST as $n=>$v)
	{
		$_SESSION[$n]=$v;
	}
	$smarty->assign('val',$_SESSION);

	
		  
	if(isset($_GET['sub']))
	{ 
	
	$db_name			= $_POST['db_name'];
	$db_userid			= $_POST['db_userid'];
	$db_pwd				= $_POST['db_pwd'];
	$db_host			= $_POST['db_host'];
	$admin_name			= $_POST['admin_name'];
	$admin_id			= $_POST['admin_id'];
	$admin_pwd			= $_POST['admin_pwd'];
	$admin_email		= $_POST['admin_email'];

	
	
	//checking the database existence//
	$link 				= @mysql_connect($db_host, $db_userid, $db_pwd);
		 if (!$link)
		 {
		  $code=mysql_errno();
		  if($code==2005)
		    {
		        $err_no=1;
		        echo "<script language='Javascript'>location='install.php?err_no=$err_no';</script>";
			}
		  if($code==1045)
		    {
			    $err_no=2;
		        echo "<script language='Javascript'>location='install.php?err_no=$err_no';</script>";
			}
		  }
	
	$flag		=@mysql_select_db($db_name);//selecting the properly selected database
	   if(!$flag)
	    { 
	       $err_no=3;echo "<script language='Javascript'>location='install.php?err_no=$err_no';</script>";
	    }
		else
		 {
		   $err_no=0;echo "<script language='Javascript'>location='install.php?';</script>";
		  }
	}
	
	$smarty->assign('err_no',$err_no);
	$smarty->display('initial.tpl');
 
?>
Return current item: CoreAsset