Cronwerks MCCode/MCCodes Forums

Please login or register.

Login with username, password and session length

News:

Make some extra cash by selling Cronwerks mods with our affiliate system.


AuthorTopic: problems in installing mc code version 2  (Read 581 times)

mdzarobin

  • Basic Member
  • *
  • Reputation Power: 1
  • mdzarobin has no influence.
  • Offline Offline
  • Posts: 3
    • View Profile
    • Email
problems in installing mc code version 2
« on: December 30, 2009, 03:27:46 AM »
when i put installer.php then it shows "internal server error"
i can sign up using login.php page
but can not install the mc code
plz someone help me
Logged

Danny696

  • Excellent Member
  • ***
  • Reputation Power: 276
  • Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.
  • Offline Offline
  • Posts: 457
    • View Profile
Re: problems in installing mc code version 2
« Reply #1 on: December 30, 2009, 09:35:02 AM »
make sure is CHMOD'ed to 655 i think
Logged
My Game: GraveYard; Madness || Projects; N/A -  Available for work. Please IM/PM me.

mdzarobin

  • Basic Member
  • *
  • Reputation Power: 1
  • mdzarobin has no influence.
  • Offline Offline
  • Posts: 3
    • View Profile
    • Email
Re: problems in installing mc code version 2
« Reply #2 on: December 30, 2009, 09:49:37 AM »
I have solved the problem
now when i go to installer.php then I found this error
Game installed at root level of domain or subdomain failed
anyone plz help me

« Last Edit: December 30, 2009, 01:17:29 PM by mdzarobin »
Logged

Maketextgames.com

  • Active Member
  • **
  • Reputation Power: 112
  • Maketextgames.com is working their way up.Maketextgames.com is working their way up.Maketextgames.com is working their way up.
  • Offline Offline
  • Posts: 204
    • MSN Messenger - immortalthug4ever@hotmail.com
    • View Profile
    • WWW
Re: problems in installing mc code version 2
« Reply #3 on: January 04, 2010, 10:10:52 PM »
Purchase a legal version of McCodes then speak with the company that sold it to you.  Im sure they'd tell you the problems ;-)

Djkanna

  • Basic Member
  • *
  • Reputation Power: 0
  • Djkanna is looked down upon.
  • Offline Offline
  • Posts: 26
    • View Profile
Re: problems in installing mc code version 2
« Reply #4 on: January 04, 2010, 11:19:19 PM »
Code: (Installer.php) [Select]
<?php
session_start
();
ob_start();
function 
valid_email($email) {
  
// First, we check that there's one @ symbol, and that the lengths are right
  
if (!ereg("^[^@]{1,64}@[^@]{1,255}$"$email)) {
    
// Email invalid because wrong number of characters in one section, or wrong number of @ symbols.
    
return false;
  }
  
// Split it into sections to make life easier
  
$email_array explode("@"$email);
  
$local_array explode("."$email_array[0]);
  for (
$i 0$i sizeof($local_array); $i++) {
     if (!
ereg("^(([A-Za-z0-9!#$%&#38;#038;'*+/=?^_`{|}~-][A-Za-z0-9!#$%&#38;#038;'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$"$local_array[$i])) {
      return 
false;
    }
  }  
  if (!
ereg("^\[?[0-9\.]+\]?$"$email_array[1])) { // Check if domain is IP. If not, it should be valid domain name
    
$domain_array explode("."$email_array[1]);
    if (
sizeof($domain_array) < 2) {
        return 
false// Not enough parts to domain
    
}
    for (
$i 0$i sizeof($domain_array); $i++) {
      if (!
ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$"$domain_array[$i])) {
        return 
false;
      }
    }
  }
  return 
true;
}
?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Mccodes Version 2</title>
<script language="JavaScript">
<!--

function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break;
  }
  return null;
}
function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

function DeleteCookie (name,path,domain) {
  if (GetCookie(name)) {
    document.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}
// -->
</script>

<script language="JavaScript">
var usr;
var pw;
var sv;
function getme()
{
usr = document.login.username;
pw = document.login.password;
sv = document.login.save;

if (GetCookie('player') != null)
{
usr.value = GetCookie('username')
pw.value = GetCookie('password')
if (GetCookie('save') == 'true')
{
sv[0].checked = true;
}
}

}
function saveme()
{
if (usr.value.length != 0 && pw.value.length != 0)
{
if (sv[0].checked)
{
expdate = new Date();
expdate.setTime(expdate.getTime()+(365 * 24 * 60 * 60 * 1000));
SetCookie('username', usr.value, expdate);
SetCookie('password', pw.value, expdate);
SetCookie('save', 'true', expdate);
}
if (sv[1].checked)
{
DeleteCookie('username');
DeleteCookie('password');
DeleteCookie('save');
}
}
else
{
alert('You must enter a username/password.');
return false;
}
}
</script>
<style type="text/css">
<!--
body {
background-color: #DEDEDE;
margin-top: 0px;
margin-bottom: 0px;
font-family:calibri, helvetica, arial, geneva, sans-serif;font-size:12px;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: 12px; }
img { border:none; }
textarea { font-family:helvetica, arial, geneva, sans-serif;font-size:12px;color: black; }
.table2 {
}
.lgrad {
background-image:url(lgrad.jpg);
background-repeat:repeat-y;
width:19px;
}
.linegrad {
background-image:url(linegrad.PNG);
background-repeat:repeat-y;
background-align: center;
width:2px;
}
.rgrad {
background-image:url(rgrad.jpg);
background-repeat:repeat-y;
width:19px;
}
.dgrad {
background-image:url(dgrad.jpg);
background-repeat:repeat-x;
height:38px;
}
.dgradl {
background-image:url(dgradl.jpg);
background-repeat:no-repeat;
height:38px;
width:38px;
}
.dgradr {
background-image:url(dgradr.jpg);
background-repeat:no-repeat;
height:38px;
width:38px;
}
.center {
width:932px;
background-color:#FFFFFF;
vertical-align:top;
text-align:center;
}
.table {
background-color:#000000;
}
.table3 {
background-color:#000000;
}
.table td {
background-color:#DEDEDE;
height:22px;
}
.table3 td {
background-color:#CCCCCC;
}
td .alt {
background-color:#EEEEEE;
height:22px;
}
td .h {
background-image:url(tablehgrad.png);
background-repeat:repeat-x;
font-weight: bold;
background-color: #D6D6D6;
}
.table th {
background-image:url(tablehgrad.png);
background-repeat:repeat-x;
font-weight: bold;
background-color: #D6D6D6;
}
-->
</style></head>
<body onload="getme();">
<center>
<table width="970" border="0" cellpadding="0" cellspacing="0" class="table2">
<tr>
<td class="lgrad"></td>

<td class="center"><img src="title.jpg" alt="Mccodes Version 2" /><br />
<!-- Begin Main Content --><h2>Installer</h2>
<?php
switch($_GET['code'])
{
case 
"install":
install(); 
break;
case 
"config":
config();
break;
default:
diagnostics();
break;
}
function 
menuprint($highlight)
{
$items=array(
'diag' => '1. Diagnostics',
'input' => '2. Configuration',
'sql' => '3. Installation & Extras',
);
$c=0;
print 
"<hr />";
foreach(
$items as $k => $v)
{
$c++;
if(
$c 1) { print " >> "; }
if(
$k==$highlight)
{
print 
"<font color='black'>{$v}</font>";
}
else
{
print 
"<font color='gray'>{$v}</font>";
}
}
print 
"<hr />";
}
function 
diagnostics()
{
menuprint("diag");
if (
version_compare(phpversion(), '4.2.0') < 0)
{
$pv="<font color='red'>Failed</font>";
$pvf=0;
}
else
{
$pv="<font color='green'>OK</font>";
$pvf=1;
}
if(
is_writable('./'))
{
$wv="<font color='green'>OK</font>";
$wvf=1;
}
else
{
$wv="<font color='red'>Failed</font>";
$wvf=0;
}
if(
function_exists('mysql_connect') || function_exists('mysqli_connect'))
{
$dv="<font color='green'>OK</font>";
$dvf=1;
}
else
{
$dv="<font color='red'>Failed</font>";
$dvf=0;
}
print 
"<h3>Basic Diagnostic Results:</h3>
<table width='80%' class='table' cellspacing='1'>
<tr>
<td>PHP version >= 4.2.0</td>
<td>{$pv}</td>
</tr>
<tr>
<td>Game folder writable</td>
<td>{$wv}</td>
</tr>
<tr>
<td>MySQL support in PHP present</td>
<td>{$dv}</td>
</tr>
</table>"
;
if(
$pvf+$wvf+$dvf 3)
{
print 
"<hr /><font color='red'>One of the basic diagnostics failed, so Setup cannot continue. Please fix the ones that failed and try again.</font><hr />";
}
else
{
print 
"<hr />&gt; <a href='installer.php?code=config'>Next Step</a><hr />";
}
}
function 
config()
{
menuprint("input");
print 
"<h3>Configuration:</h3>
<center>
<form action='installer.php?code=install' method='post'>
<table width='75%' class='table' cellspacing='1'>
<tr>
<th colspan='2'>Database Config</th>
</tr>
<tr>
<td align='center'>MySQL Driver</td>
<td><select name='driver' type='dropdown'>"
;
if(
function_exists('mysql_connect')) { print "<option value='mysql'>MySQL Standard</option>"; }
if(
function_exists('mysqli_connect')) { print "<option value='mysql'>MySQLi Enhanced</option>"; }
print 
"</select></td>
</tr>
<tr>
<td align='center'>Hostname<br />
<small>This is usually localhost</small></td>
<td><input type='text' name='hostname' value='localhost' /></td>
</tr>
<tr>
<td align='center'>Username<br />
<small>The user must be able to use the database</small></td>
<td><input type='text' name='username' value='' /></td>
</tr>
<tr>
<td align='center'>Password</td>
<td><input type='text' name='password' value='' /></td>
</tr>
<tr>
<td align='center'>Database Name<br />
<small>The database should not have any other software using it.</small></td>
<td><input type='text' name='database' value='' /></td>
</tr>
<tr>
<th colspan='2'>Game Config</th>
</tr>
<tr>
<td align='center'>Game Name</td>
<td><input type='text' name='game_name' /></td>
</tr>
<tr>
<td align='center'>Game Owner<br />
<small>This can be your nick, real name, or a company</small></td>
<td><input type='text' name='game_owner' /></td>
</tr>
<tr>
<td align='center'>Game Description<br />
<small>This is shown on the login page.</small></td>
<td><textarea rows='6' cols='40' name='game_description'></textarea></td>
</tr>
<tr>
<td align='center'>PayPal Address<br />
<small>This is where the payments for game DPs go. Must be at least Premier.</small></td>
<td><input type='text' name='paypal' /></td>
</tr>
<tr>
<th colspan='2'>Admin User</th>
</tr>
<tr>
<td align='center'>Username</td>
<td><input type='text' name='a_username' /></td>
</tr>
<tr>
<td align='center'>Password</td>
<td><input type='password' name='a_password' /></td>
</tr>
<tr>
<td align='center'>Confirm Password</td>
<td><input type='password' name='a_cpassword' /></td>
</tr>
<tr>
<td align='center'>E-Mail</td>
<td><input type='text' name='a_email' /></td>
</tr>
<tr>
<td align='center'>Gender</td>
<td><select name='gender' type='dropdown'>
<option value='Male'>Male
<option value='Female'>Female</select></td>
</tr>
<tr>
<td colspan='2' align='center'><input type='submit' value='Install' /></td>
</tr>
</table></form></center>"
;
}
function 
install()
{
menuprint("sql");

if(
$_POST['a_password'] != $_POST['a_cpassword'])
{
print 
"The admin passwords did not match.";
}
else if(!
valid_email($_POST['a_email']))
{
print(
"Sorry, the email used for the admin user is invalid.");
}
else if(!
valid_email($_POST['paypal']))
{
print(
"Sorry, the email used for the PayPal is invalid.");
}
else if(
strlen($_POST['a_username']) < 4)
{
die(
"Sorry, the admin username is too short.<br />
"
);
}
else
{
print 
"Write Config...<br>";
$code=md5(rand(1,100000000000));
if(
file_exists("config.php")) { unlink("config.php"); }
$f=fopen("config.php""w");
fwrite($f"<?php
\$_CONFIG = array(
'hostname' => '{$_POST['hostname']}',
'username' => '{$_POST['username']}',
'password' => '{$_POST['password']}',
'database' => '{$_POST['database']}',
'persistent' => 0,
'driver' => '{$_POST['driver']}',
'code' => '{$code}'
);
?>
");
fclose($f);
print "Config written.<br>
Attempting DB connection<br>";
define('MONO_ON', 1);
require "class/class_db_{$_POST['driver']}.php";
$db=new database;
$db->configure($_POST['hostname'],
 $_POST['username'],
 $_POST['password'],
 $_POST['database'],
 0);
$db->connect();
$c=$db->connection_id;
print "Connection Successful.<br>
Writing Main MySQL data.<br>";
$fo=fopen("dbdata.sql","r");
    $query="";
    $lines=explode("\n",fread($fo,1024768));
    fclose($fo);
    foreach($lines as $line)
    {
     if(!(strpos($line,"--") === 0) && trim($line) != "") //check for commented lines or blankies
     {
      $query.=$line;
      if(!(strpos($line,";") === FALSE))
      {
       $db->query($query);
       $query="";
      }
     }
    }
print "Main MySQL data was written.<br />
Now write Extra MySQL data.<br />";
$username=$_POST['a_username'];
$IP = ($_SERVER['HTTP_X_FORWARDED_FOR'])
    ?  $_SERVER['HTTP_X_FORWARDED_FOR']
    :  $_SERVER['REMOTE_ADDR'];
$db->query("INSERT INTO users (username, login_name, userpass, level, money, crystals, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney, lastip, lastip_signup) VALUES( '{$username}', '{$username}', md5('{$_POST['a_password']}'), 1, 100, 0, 0, 2, 12, 12, 100, 100, 5, 5, 100, 100, 1, '{$_POST['a_gender']}', unix_timestamp(), '{$_POST['a_email']}', -1, '$IP', '$IP')");
$i=$db->insert_id();
$db->query("INSERT INTO userstats VALUES($i, 10, 10, 10, 10, 10)");
$db->query("INSERT INTO settings VALUES(NULL, 'game_name', '{$_POST['game_name']}')");
$db->query("INSERT INTO settings VALUES(NULL, 'game_owner', '{$_POST['game_owner']}')");
$db->query("INSERT INTO settings VALUES(NULL, 'paypal', '{$_POST['paypal']}')");
$db->query("INSERT INTO settings VALUES(NULL, 'game_description', '{$_POST['game_description']}')");
$path=$_SERVER['HTTP_HOST'];
print "<b>Installation Complete!</b><hr />
<u>Cron Info</u><br />
This is the cron info you need for section <b>1.2 Cronjobs</b> of the installation instructions.<br /><pre>
*/5 * * * * curl http://$path/cron_fivemins.php?code=$code
* * * * * curl http://$path/cron_minute.php?code=$code
0 * * * * curl http://$path/cron_hour.php?code=$code
0 0 * * * curl http://$path/cron_day.php?code=$code</pre>";
}
}
?>
</td>
<td class="rgrad"></td>
</tr>
<tr>

<td colspan="3">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td class="dgradl">&nbsp;</td>

<td class="dgrad">&nbsp;</td>
<td class="dgradr">&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

Use this  ;)
Logged

05timbyd

  • Basic Member
  • *
  • Reputation Power: 3
  • 05timbyd has no influence.
  • Offline Offline
  • Posts: 7
    • View Profile
    • Email
Re: problems in installing mc code version 2
« Reply #5 on: March 07, 2010, 03:23:13 PM »
Or why don't you goto PHPmyAdmin ;)
Logged

Jordan

  • Active Member
  • **
  • Reputation Power: 55
  • Jordan has no influence.
  • Offline Offline
  • Posts: 103
  • Website Developer for hire;
    • MSN Messenger - Pudda2008@hotmail.co.uk
    • View Profile
    • WWW
    • Email
Re: problems in installing mc code version 2
« Reply #6 on: March 10, 2010, 10:47:38 AM »
I manually install my versions, Much easier :)
Logged

Pudda2008@hotmail.co.uk - Feel free to add me on MSN

Prostate

  • Basic Member
  • *
  • Reputation Power: 7
  • Prostate has no influence.
  • Offline Offline
  • Posts: 13
  • Join my game
    • View Profile
    • WWW
    • Email
Re: problems in installing mc code version 2
« Reply #7 on: May 11, 2010, 11:19:28 AM »
Umm Extract the game and upload each file one by one
Logged