Where else to start, than the installer.php. Has not been tested.
Heres mine:
<?php
//This file was Coded by Danny696
//Coded for McCodes Lite V2
?>
<html><head>
<title>McCodes Lite V2 Installer.</title>
<style type="text/css" media="screen">
body
{
font-family:helvetica, arial, geneva, sans-serif;font-size:12;color: black;
scrollbar-base-color: #005B70;
scrollbar-arrow-color: #F3960B;
scrollbar-DarkShadow-Color: #000000;
}
a:visited,a:active,a:hover,a:link
{
color: black;text-decoration: none;
}
table,tr,td
{
font-family:helvetica, arial, geneva, sans-serif;font-size: 12;
}
img
{
border:none;
}
textarea
{
font-family:helvetica, arial, geneva, sans-serif;font-size:12;color: black;
}
</style>
</head>
<h1>McCodes Lite V2 Install Process.</h1>
<?php
$_REQUEST['action'] = isset($_REQUEST['action']) && is_string($_REQUEST['action']) ? strtolower(trim($_REQUEST['action'])) : false; //check the action is a word
switch($_REQUEST['action'])
{
default: Start_my_install(); break;
case'installl':Done_my_install(); break;
}
function Done_my_install()
{
echo'Step 1. Config -> <span style="font-weight: 800px;">Step 2. Install.</span><br />';
echo'<script type="text/javascript">
function notice()
{
alert(\'This file will be delete when you have installed the game.\');
}
<body onload\'notice()\'>
';
if(!is_writable('mysql.php'))
{
echo'<script type="text/javascript">
function error_1()
{
alert(\'Error. The file mysql.php is not writeable, please CHMOD it to 0777.\');
}
</script>
<body onload=\'error_1()\'>
';
exit;
}
if(!$_POST['dbHostName'] || !$_POST['dbUserName'] || !$_POST['dbDatabase'] || !$_POST['adUsername'] || !$_POST['adPassword'] || !$_POST['adCPassword'] || !$_POST['adEmail'])
{
echo'<script type="text/javascript">
function error_2()
{
alert(\'Error. You missed one or more fields Go back and try again.\');
}
</script>
<body onload=\'error_2()\'>
';
exit;
}
if($_POST['adPassword'] != $_POST['adCPassword'])
{
echo'<script type="text/javascript">
function error_3()
{
alert(\'Error. The passwords you spplied, do not match.\');
}
</script>
<body onload=\'error_3()\'>
';
exit;
}
$c = mysql_connect($_POST['dbHostName'], $_POST['dbUserName'], $_POST['dbPassword']) or die("<span style='font-color: red; font-weight: 800px;>INSTALLATION ERROR:</span><span style='font-weight: 800px;> ".mysql_error()."<br />> <a href='installer.php'>Back</a></span>");
mysql_select_db($_POST['dbDatabase'], $c) or die("<span style='font-color: red; font-weight: 800px;>INSTALLATION ERROR:</span><span style='font-weight: 800px;> ".mysql_error()."<br />> <a href='installer.php'>Back</a></span>");
$l=fopen("mysql.php","w");
$mykey=rand(1,2147483647);
fwrite($l,"<?php
\$c = mysql_connect('{$_POST['dbHostName']}', '{$_POST['dbUserName']}', '{$_POST['dbPassword']}');
mysql_select_db('{$_POST['dbDatabase']}', \$c);
\$mykey={$mykey};
?>");
fclose($l);
echo'Wrote mysql.php file..Adding Database...<br />';
$fo=fopen("dbdata.sql","r");
$query="";
$lines=explode("\n",fread($fo,1024768));
fclose($fo);
foreach($lines as $line)
{
if(!(strpos($line,"--") === 0) && $line != "") //check for commented lines or blankies
{
$query.=$line;
if(!(strpos($line,";") === FALSE))
{
$query=str_replace(array('adUsername', 'adPassword', 'adEmail'), array($_POST['adUsername'], $_POST['adPassword'], $_POST['adEmail']), $query);
mysql_query($query,$c) or die("<span style='font-color: red; font-weight: 800px;>INSTALLATION ERROR:</span><span style='font-weight: 800px;> ".mysql_error()."<br />> <a href='installer.php'>Back</a></span>");
$query="";
}
}
}
echo'Wrote Database..Making crons...<br />';
$path=$_SERVER['HTTP_HOST'].str_replace('installer.php','',$_SERVER['SCRIPT_NAME']);
$cj1="http://".$path."cron_fivemins.php?code=".md5($path.$mykey);
$cj2="http://".$path."cron_day.php?code=".md5($path.$mykey);
echo'<hr /><span style="font-weight: 800px;">Done!<hr />Do not close this window!</span><br />
You need to install these crons into cPanel or whatever Control panel you have.<br />
<pre>
*/5 * * * * curl '.$cj1.'
0 0 * * * curl '.$cj2.'
</pre>
When you have done this, login and Enjoy McCodes Lite V2.';
unlink("installer.php");
}
function Start_my_install()
{
echo'<span style="font-weight: 800px;">Step 1. Config</span> -> Step 2. Install.<br />';
if(!is_writable('mysql.php'))
{
echo'<script type="text/javascript">
function error_1()
{
alert(\'Error. The file mysql.php is not writeable, please CHMOD it to 0777.\');
}
</script>
<body onload=\'error_1()\'>
';
exit;
}
?><span style="font-weight: 800px;">Database Details:</span><br />
<form action='?action=installl' method='post'>
<table width='70%' border='1'>
<tr>
<td>MySQL Hostname:<br />
<small><span style="font-weight: 800px;">localhost</span> is the default on most servers.</small></td>
<td><input type='text' name='dbHostName' /></td>
</tr>
<tr>
<td>MySQL Username:</td>
<td><input type='text' name='dbUserName' /></td>
</tr>
<tr>
<td>MySQL Password:</td>
<td><input type='password' name='dbPassword' /></td>
</tr>
<tr>
<td>MySQL Database:<br />
<small>Please make sure the user has access to the database.</small></td>
<td><input type='text' name='dbDatabase' /></td>
</tr>
</table>
<hr />
<span style="font-weight: 800px;">Game Admin Details</span><br />
<table width='70%' border='1'>
<tr>
<td>Admin Username:</td>
<td><input type='text' name='adUsername' /></td>
</tr>
<tr>
<td>Admin Password:</td>
<td><input type='password' name='adPassword' /></td>
</tr>
<tr>
<td>Confirm Password:</td>
<td><input type='password' name='adCPassword' /></td>
</tr>
<tr>
<td>Admin Email Address:</td>
<td><input type='text' name='adEmail' /></td>
</tr>
</table>
<input type='submit' value='Install' />
</form>
<?php
}
?>
</body></html>