Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

MultiOnline package help!!

Discussion in 'Multiplayer' started by spaceapevisuals, Feb 17, 2015.

  1. spaceapevisuals

    spaceapevisuals

    Joined:
    Feb 16, 2015
    Posts:
    2
    Hi guys,

    I downloaded MultiOnline package to make my game multiplayer. I have watched the videos and done the tutorials. Ive uploaded everything necessary on FTP. When you get to the stage where you have to click on install.php ,this menu is supposed to come up to fill in all the boxes, which ive got all the information for but all this it openes up in code format! SEe below, how do I get past this?? Thanks!
    This code appears when you click on install.php in the above picture.

    <?php
    $successData = false;
    $successCreate = false;
    if(isset($_POST['submitData'])){
    if(!empty($_POST['mysqlHost']) && !empty($_POST['dataBase']) && !empty($_POST['name']) && !empty($_POST['pass'])) {

    $fp = fopen ('functions/logData.php', 'w');
    $content = '<?php ';
    $content.= '$logUser = \''.$_POST['name'].'\';';
    $content.= '$logPass = \''.$_POST['pass'].'\';';
    $content.= '$logHost = \''.$_POST['mysqlHost'].'\';';
    $content.= '$logDbName = \''.$_POST['dataBase'].'\';';
    $content.= '?>';
    fwrite($fp, $content);
    fclose($fp);
    $message = 'Your database login data are well saved.';
    $successData = true;
    } else {
    $message = 'Please, fill all the fields';
    }
    } elseif (isset($_POST['submitCreate'])){
    include 'functions/functions.php';
    $db = new MODb($logUser, $logPass, $logHost, $logDbName);
    $file = 'dataBase.sql';
    $content = fread(fopen($file, 'r'), filesize($file));
    //echo($content);
    $db->exec($content);
    //echo $db->getError;
    $message = 'Your database have been created, the installation is complete.';
    $message2= '<br/>Now, delete this page of your web server (you can keep a copy locally to be able to change the data later).';
    $successCreate = true;
    }
    ?>
    <!DOCTYPE html>
    <html>
    <header>
    <title>MultiOnline installation</title>
    <style>
    body {
    font-family:"arial";
    margin: 50px;
    }
    h1 {
    color: #0080FF;
    } div {
    border-width: 3px;
    border-style: solid ;
    border-color: #D8D8D8;
    padding: 30px;
    }
    </style>
    </header>
    <body>
    <h1>MultiOnline installation</h1>
    <br>
    <?php echo $message; ?>
    <br>
    <div>
    <?php
    if($successCreate){ echo $message2;}
    elseif ($successData) { ?>
    <form method="POST" action="">
    <table>
    <tr>
    <td></td>
    <td><input type="submit" name="submitCreate" value="Create database" style="width:100%"/></td>
    </tr>
    </table>
    </form>

    <?php } else { ?>

    <form method="POST" action="">
    <table>
    <tr>
    <td>MYSQL host:</td>
    <td><input type="text" name="mysqlHost" value="<?php echo $_POST['mysqlHost']?>"/></td>
    </tr>
    <tr>
    <td>Database name:</td>
    <td><input type="text" name="dataBase" value="<?php echo $_POST['dataBase']?>"/></td>
    </tr>
    <tr>
    <td>User name:</td>
    <td><input type="text" name="name" value="<?php echo $_POST['name']?>"/></td>
    </tr>
    <tr>
    <td>Password:</td>
    <td><input type="password" name="pass" /></td>
    </tr>
    <tr>
    <td></td>
    <td></td>
    </tr>
    <tr>
    <td></td>
    <td><input type="submit" name="submitData" value="Continue" style="width:100%"/></td>
    </tr>
    </table>
    </form>
    <?php } ?>
    </div>
    </body>
    </html>
     
  2. Ghidera

    Ghidera

    Joined:
    Mar 6, 2013
    Posts:
    53
    Those are basically scripts you can from within your game to talk to a database. You have to have some understanding of the database (MariaDB, Postgres, MySQL whatever) or you're probably not going to get anywhere.
     
  3. Neoshiftr

    Neoshiftr

    Joined:
    Dec 5, 2012
    Posts:
    67
    Is PHP installed on your webserver?