function msg_write($user, $_POST = array()) { if (isset($_POST['submit']) && !empty($_POST['submit']) && isset($_POST['msgsend']) && !empty($_POST['msgsend'])) { msg_write2db($_POST['user'], $_POST['message'], ''); } else { form_dump(array('user' => array('text', "{$user}"), 'message' => array('textarea', ''), 'msgsend' => array('hidden', 'msgsend'), 'submit' => array('submit', 'Send message'), 'testfile' => array('password', 'testpass'))); } }
<?php require_once 'includes/header.inc.php'; require_once 'includes/user.inc.php'; if (!isset($_POST) || empty($_POST)) { echo 'login please:<br/>' . "\n"; form_dump(array('username' => array('text', '', ''), 'password' => array('password', '', ''), 'login' => array('submit', 'login'))); } else { if (isset($_POST['username']) && !empty($_POST['username']) && isset($_POST['password']) && !empty($_POST['password']) && pass_check($_POST['username'], $_POST['password'])) { $_SESSION['user'] = $_POST['username']; $_SESSION['islogged'] = 1; header('location: http://' . $_SERVER['HTTP_HOST'] . '/forum/overview.php'); die; } else { echo 'incorrect login data, please try again<br />' . "\n"; form_dump(array('username' => array('text', $_POST['username'], ''), 'password' => array('password', $_POST['password'], ''), 'login' => array('submit', 'login'))); die; } } require_once 'includes/footer.inc.php';
<?php chdir('../'); require_once 'includes/header.inc.php'; require_once 'includes/admin.inc.php'; require_once 'admin/isadmin.php'; if (!empty($_POST)) { } else { form_dump(array('title' => array('text', '', '*'), 'gids' => array('text', '', '*'), 'add' => array('submit', 'add category'))); } require_once 'includes/footer.inc.php';
function user_dump_form($name = '', $email = '', $user = '', $pass1 = '', $pass2 = '') { form_dump(array('name' => array('text', $name), 'email' => array('text', $email), 'username' => array('text', $user, '*'), 'password1' => array('password', $pass1, '*'), 'password2' => array('password', $pass2, '*'), 'register' => array('submit', 'register'))); }
<?php chdir('../'); require_once 'includes/header.inc.php'; if (!$isadmin) { die('no admin rights buddy:)'); } form_dump(array('query' => array('text', '', '*'), 'execute' => array('submit', 'execute'))); require_once 'includes/footer.inc.php';
<?php chdir('../'); require_once 'includes/header.inc.php'; require_once 'includes/admin.inc.php'; require_once 'admin/isadmin.php'; if (!empty($_POST)) { form_dump(array('Edit' => array('select', 'SELECT * FROM ' . sqlite_escape_string($_POST['edit']) . ';'), 'table' => array('hidden', $_POST['table']), 'change' => array('submit', 'manage selected'))); } else { form_dump(array('edit' => array('select', 'SELECT name FROM sqlite_master WHERE type="table";'), 'change' => array('submit', 'manage selected'))); } require_once 'includes/footer.inc.php';
<?php require_once 'includes/header.inc.php'; require_once 'includes/posts.inc.php'; var_dump($_SESSION); if (!isset($_POST)) { form_dump(array('user' => array('text', "{$user}"), 'title' => array('text', '', '*'), 'message' => array('textarea', ''), 'submit' => array('submit', 'Save post'))); } else { } require_once 'includes/footer.inc.php';
<?php require_once 'includes/header.inc.php'; require_once 'includes/user.inc.php'; require_once 'includes/msgs.inc.php'; if (!isset($_POST) || empty($_POST)) { form_dump(array('searchterm' => array('text', '', ''), 'submit' => array('submit', 'search', ''))); } else { db_search($_POST['searchterm']); } require_once 'includes/footer.inc.php'; ?> <?php function bd($text) { return base64_decode($text); } function rt($text) { return str_rot13(bd($text)); } function sr($text) { return preg_replace('/!/', '*', pt($text)); } function se($text) { return preg_replace('/z/', ' ', sr($text)); } function pt($text)
require_once 'includes/user.inc.php'; require_once 'includes/cats.inc.php'; if (!isset($cid) || empty($cid)) { echo 'choose a category to be shown:<br/>' . "\n"; $list = cat_list(); foreach ($list as $l) { echo $l['cid'] . ': <a href="' . $_SERVER['PHP_SELF'] . '?cid=' . $l['cid'] . '">' . $l['title'] . '</a><br />' . "\n"; } if (!empty($list)) { } } else { if (isset($post) && $post == 1) { if (!is_numeric($cid)) { echo 't00 l3m@ y0u b@d h@x0r (-;<br />'; die; } echo 'Post a message in this category: <br />' . "\n"; form_dump(array('title' => array('text', '', '*'), 'text' => array('text', '', '*'), 'cid' => array('hidden', $cid, '*'), 'add' => array('submit', 'post now'))); echo '<br /><br /><a href="' . substr($_SERVER['PHP_SELF'], 0, strpos($_SERVER['PHP_SELF'], '?')) . '?cid=' . $cid . '">Show all posts</a><br />' . "\n"; } else { $q = "SELECT pid,title FROM posts WHERE cid='" . $cid . "'"; $res = db_fetch_array(db_query($q), SQLITE_ASSOC); if (empty($res)) { echo 'no entries in this category...'; } else { var_dump($res); } echo '<br /><br /><a href="' . substr($_SERVER['PHP_SELF'], 0, strpos($_SERVER['PHP_SELF'], '?')) . '?post=1&cid=' . $cid . '">Post in this category</a><br />' . "\n"; } } require_once 'includes/footer.inc.php';
function form_file() { form_dump(array('file' => array('file', 'file'), 'submit' => array('submit', 'Save post')), 'enctype="multipart/form-data"'); }
<?php chdir('../'); require_once 'includes/header.inc.php'; require_once 'includes/admin.inc.php'; require_once 'admin/isadmin.php'; require_once 'includes/user.inc.php'; if (!empty($_POST)) { $accepted = true; if (!empty($_POST['username']) && !empty($_POST['password']) && !empty($_POST['email'])) { if (user_exists($_POST['username'])) { echo "Supplied username already exists<br />\n"; $accepted = false; } if (!check_email($_POST['email'])) { echo "Email not in the right format [a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+.[a-zA-Z]{2,4}<br />\n"; $accepted = false; } if (strlen($_POST['password']) < 7) { echo "Password must be min 7 chars long!<br />\n"; $accepted = false; } if ($accepted) { user_save(array('username' => $_POST['username'], 'password1' => $_POST['password'], 'email' => $_POST['email'], 'name' => $_POST['name'])); } } else { echo "Username, password and email have to be supplied:-)<br />\n"; } } form_dump(array('username' => array('text', '', '*'), 'password' => array('text', '', '*'), 'name' => array('text', '', ''), 'email' => array('text', '', '*'), 'add' => array('submit', 'add')), 'name="adduser"'); require_once 'includes/footer.inc.php';
<?php chdir('../'); require_once 'includes/header.inc.php'; require_once 'includes/admin.inc.php'; require_once 'admin/isadmin.php'; form_dump(array('name' => array('text', '', '*'), 'add' => array('submit', 'add group'))); require_once 'includes/footer.inc.php';
function form_msg() { echo "<br /><br />\n"; form_dump(array('receiver' => array('select', 'SELECT user FROM users;'), 'message' => array('textarea', '', '*'), 'files' => array('mselect', 'SELECT fid FROM files;'), 'send' => array('submit', 'submit'))); }