<?php require_once 'VPDB.php'; require_once 'header.php'; require_once 'Parser.php'; $db = new VPDB(); if (isset($_POST['pattern'])) { // adding pattern $db->addPattern($username, $_POST['pattern']); $parser = new Parser(); } ?> <div id="patterns"> <?php foreach ($db->getPatterns($username, true) as $pattern) { ?> <?php echo "<p><a href='themes.php?pattern={$pattern}'>{$pattern}</a></p>\n"; ?> <?php } ?> <div> <form action="patterns.php" method="POST"> <input type="text" name="pattern"> <input type="submit" value="Add pattern"> </form> </div> </div>
<?php require_once "settings.php"; require_once 'erron.php'; require_once 'VPDB.php'; $username = $_POST['username']; $password = hash('ripemd128', $_POST['password'] . $salt); $db = new VPDB(); if ($output = $db->authorizeUser($username, $password) === true) { echo "Authorized"; } else { echo $output; }
<?php require_once 'VPDB.php'; require_once 'header.php'; $pattern = $_GET['pattern']; $db = new VPDB(); $themes = $db->getThemes($pattern); // TODO: new themes? foreach ($themes as $theme) { ?> <ul> <li> <a href="http://forum.velomania.ru/showthread.php?t=<?php echo $theme->id; ?> " > <?php echo $theme->title; ?> </a> </li> </ul> <?php }
<?php /** * Created by PhpStorm. * User: urf * Date: 9/11/14 * Time: 9:50 AM */ require_once 'settings.php'; require_once "VPDB.php"; require_once 'erron.php'; if ($_POST["invitation_code"] != $invitation_code) { exit("Wrong invitation code!"); } $username = $_POST['username']; $password = hash('ripemd128', $_POST['password'] . $salt); $db = new VPDB(); if ($output = $db->registerUser($username, $password) === true) { echo "Registration successful!"; } else { echo $output; }
<?php require_once 'VPDB.php'; $db = new VPDB(); $db->createDB();