} $result = $mysqli->query($query) or showerror(); $row = mysqli_fetch_assoc($result); if (!isset($row['rurl']) || strlen($row['rurl']) < 1) { header("Location: 404.php", true, 302); die; } if (strtolower($row['rurl']) == "disabled") { require_once 'layout-headerlg.php'; echo "<h2>The link you are trying to reach has been disabled.</h2><br>" . "Sorry for the inconvienience."; require_once 'layout-footerlg.php'; die; } $lkey = @$row['lkey']; if (strlen($lkey) > 1) { // check for key $sent_lkey = isset($_GET[$lkey]); if ($sent_lkey) { // correct key } else { require_once 'layout-headerlg.php'; echo "Incorrect Key. (http://{$wsa}/abc?keyhere)"; require_once 'layout-footerlg.php'; die; } } header("Location: {$row['rurl']}", true, 301); $oldclicks = sqlfetch("redirinfo", "clicks", "baseval", $val); $newclicks = $oldclicks + 1; sqlrun("UPDATE redirinfo SET clicks='{$newclicks}' WHERE baseval='{$val}'");
`user` tinytext NOT NULL, `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `country` tinytext NOT NULL, `theme` varchar(65) NOT NULL, `clicks` int(11) NOT NULL, `pw` int(120) NOT NULL, `etc` text, `etc2` text, PRIMARY KEY (`rid`), KEY `baseval` (`baseval`), KEY `ip` (`ip`), KEY `iscustom` (`iscustom`) );'); $acctpass = hashpass($_POST['acctpass']); $nr = sha1(rstr(50)); sqlrun("INSERT INTO auth (username,email,password,rkey,valid,role) VALUES ('{$_POST['acct']}','{$_POST['acctemail']}','{$acctpass}','{$nr}','1','adm') "); echo "You are now finished Polr Setup. You can now close this window, and login to your account <a href='index.php'>here</a> (login form @ top right). <br><br>If you need help, click <a href=\"http://webchat.freenode.net/?channels=#polr\">here</a><br>" . "<br><br><b>Clueless? Read the docs. <a href='https://github.com/Cydrobolt/polr/blob/master/README.md'>https://github.com/Cydrobolt/polr/blob/master/README.md</a></b>"; } else { include 'version.php'; echo "<form name=\"Config Creation\" style='margin:0 auto; width: 650px' method=\"post\" action=\"" . 'setup.php' . "\">"; // DB Config echo "<b style=\"text-align:center\">Database Configuration</b><br />"; echo "Database Host: <input type=\"text\" class='form-control' style='width:650px' name=\"dbserver\" value=\"localhost\"><br>"; echo "Database User: <input type=\"text\" class='form-control' style='width:650px' name=\"dbuser\" value=\"root\"><br>"; echo "Database Pass: <input type=\"password\" class='form-control' style='width:650px' name=\"dbpass\" value=\"password\"><br>"; echo "Database Name: <input type=\"text\" class='form-control' style='width:650px' name=\"dbname\" value=\"polr\"><br>"; // App Config echo "<br /><b style=\"text-align:center\">Application Settings</b><br />"; echo "Application Name: <input type=\"text\" class='form-control' style='width:650px' name=\"appname\" value=\"Polr\"><br>"; echo "Application URL (path to Polr, no http://, www., or trailing slash) : <input type=\"text\" style='width:650px' class='form-control' name=\"appurl\" value=\"yoursite.com\"><br>"; echo "Fetch ip through variable: <input type=\"text\" class='form-control' style='width:650px' name=\"ipfetch\" value=\"\$_SERVER['REMOTE_ADDR']\"><br>";
`iscustom` varchar(4) NOT NULL, `user` tinytext NOT NULL, `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `country` tinytext NOT NULL, `clicks` int(11) NOT NULL, `pw` int(120) NOT NULL, `etc` text, `etc2` text, PRIMARY KEY (`rid`), KEY `baseval` (`baseval`), KEY `ip` (`ip`), KEY `iscustom` (`iscustom`) );'); $acctpass = hashpass($_POST['acctpass']); $nr = sha1(rstr(50)); sqlrun("INSERT INTO auth (username,email,password,rkey,valid,role,theme,ip) VALUES ('{$_POST['acct']}','{$_POST['acctemail']}','{$acctpass}','{$nr}','1','adm','{$site_theme}','{$ip}') "); echo "You are now finished Polr Setup. You can now close this window, and login to your account <a href='index.php'>here</a> (login form @ top right). <br /><br />If you need help, click <a href=\"http://webchat.freenode.net/?channels=#polr\">here</a><br />" . "<br /><br /><b>Clueless? Read the docs. <a href='https://github.com/Cydrobolt/polr/blob/master/README.md'>https://github.com/Cydrobolt/polr/blob/master/README.md</a></b>"; } else { include 'version.php'; echo "<form name=\"Config Creation\" style='margin:0 auto; width: 650px' method=\"post\" action=\"" . 'setup.php' . "\">"; // DB Config echo "<b style=\"text-align:center\">Database Configuration</b><br />"; echo "Database Host: <input type=\"text\" class='form-control' style='width:650px' name=\"dbserver\" value=\"localhost\"><br />"; echo "Database User: <input type=\"text\" class='form-control' style='width:650px' name=\"dbuser\" value=\"root\"><br />"; echo "Database Pass: <input type=\"password\" class='form-control' style='width:650px' name=\"dbpass\" value=\"password\"><br />"; echo "Database Name: <input type=\"text\" class='form-control' style='width:650px' name=\"dbname\" value=\"polr\"><br />"; // App Config echo "<br /><b style=\"text-align:center\">Application Settings</b><br />"; echo "Application Name: <input type=\"text\" class='form-control' style='width:650px' name=\"appname\" value=\"Polr\"><br />"; echo "Application URL (path to Polr, no http://, www., or trailing slash) : <input type=\"text\" style='width:650px' class='form-control' name=\"appurl\" value=\"yoursite.com\"><br />"; echo "Fetch ip through variable: <input type=\"text\" class='form-control' style='width:650px' name=\"ipfetch\" value=\"\$_SERVER['REMOTE_ADDR']\"><br />";