Location: PHPKode > scripts > SHDetect > joshf-SHDetect-f0c6c96/installer/index.php
<!-- SHDetect, Copyright Josh Fradley (http://github.com/joshf/SHDetect) -->
<html>
<head>
<title>SHDetect: Installer</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<link rel="stylesheet" type="text/css" href="../style.css" />
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript" src="//jzaefferer.github.com/jquery-validation/jquery.validate.js"></script>
</head>
<body>
<?php

//Security check
if (file_exists("../config.php")) {
    die("<h1>SHDetect: Error</h1><p>SHDetect has already been installed! If you wish to reinstall SHDetect, please delete config.php from your server and run this script again.</p><hr /><p><a href=\"../admin\">Go To Admin Home</a></p></body></html>"); 
}

$version = "2.1.2";

//Get path to script
$currenturl = $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
$pathtoscriptwithslash = "http://" . substr($currenturl, 0, strpos($currenturl, "installer"));
$pathtoscript = rtrim($pathtoscriptwithslash, "/");

?>
<script type="text/javascript">
$(document).ready(function() {
    $.ajax({  
        type: "POST",  
        url: "http://sidhosting.co.uk/misc/installs/detect.php",  
        data: "product=shdetect&url=<? echo $pathtoscript ?>&version=<? echo $version; ?>",
    });
    $.validator.addMethod(
        "legalurl",
        function(value, element) { 
            return this.optional(element) || /^[a-zA-Z0-9.?=:#_\-/\-]+$/.test(value);
        },
        "Please enter a valid URL."
    ); 
    $("#installform").validate({
        rules: {
            adminpassword: {
                required: true,
            },
            dbhost: {
                required: true,
            },
            dbuser: {
                required: true,
            },
            dbpassword: {
                required: true,
            },
            dbname: {
                required: true,
            },
            adminuser: {
                required: true,
            },
            adminemail: {
                required: true,
                email: true
            },
            adminpassword: {
                required: true,
                minlength: 6
            },
            adminpasswordconfirm: {
                equalTo: "#adminpassword",
            },
            appname: {
                required: true,
            },
            appversion: {
                required: true,
            },
            appbuild: {
                required: true,
                number: true
            },
            field1: {
                required: true,
            },
            field2: {
                required: true,
            },
            field3: {
                required: true,
            },
            pathtoscript: {
                required: true,
                legalurl: true
            }
        }
    });
});
</script>
<h1>SHDetect: Installer</h1>
<p><i>All fields are required!</i></p>
<form action="install.php" method="post" id="installform" >
<p><b>Database Settings:</b></p>
Host: <input type="text" name="dbhost" value="localhost" /><br />
User: <input type="text" name="dbuser" /><br />
Password: <input type="password" name="dbpassword" /><br />
Name: <input type="text" name="dbname" /><br />
<p><b>Admin Details:</b></p>
User: <input type="text" name="adminuser" /><br />
Email: <input type="text" name="adminemail" /><br />
Password: <input type="password" name="adminpassword" id="adminpassword" /><br />
Confirm Password: <input type="password" name="adminpasswordconfirm" /><br />
<p><b>App Settings:</b></p>
App Name: <input type="text" name="appname" /><br />
App Version: <input type="text" name="appversion" /><br />
App Build: <input type="text" name="appbuild" /><br />
<p><i>These will be the variables your SHDetect installation will receive. These will be coverted to lowercase.</i></p>
Field 1: <input type="text" name="field1" value="Build" /><br />
Field 2: <input type="text" name="field2" value="OS" /><br />
Field 3: <input type="text" name="field3" value="Language" /><br />
<p><b>Other Settings:</b></p>
Path to Script: <input type="text" name="pathtoscript" value="<? echo $pathtoscript; ?>" /><br />
<input type="hidden" name="doinstall" />
<p><input type="submit" value="Install" /></p>
</form>
<small>SHDetect <? echo $version; ?> Copyright <a href="http://github.com/joshf">Josh Fradley</a> <? echo date("Y"); ?></small>
</body>
</html>
Return current item: SHDetect