Example #1
0
<?php

pushKeywords('web', 'tool', 'easy', 'simple');
loadModules('strings.php');
setTitle('Tools for the Compuationally Impaired');
Example #2
0
<?php

define('NUMCAP', 100);
loadSyrups('tools.php');
pushKeywords('random', 'number', 'generator');
setTitle('Random Number Generator::' . $SP_TITLE);
pushStyles('numbers.css');
$number = null;
$min = 0;
$max = 100;
if (!isempty($_POST['number'])) {
    $number = intval($_POST['number']);
    if ($number < 0) {
        $number = 0;
    } elseif ($number > NUMCAP) {
        $number = NUMCAP;
    }
}
if (!isempty($_POST['min'])) {
    $min = intval($_POST['min']);
}
if (!isempty($_POST['max'])) {
    $max = intval($_POST['max']);
}
if ($min > $max) {
    $tmp = $min;
    $min = $max;
    $max = $tmp;
}
include ROOT . '/header.php';
?>
Example #3
0
<?php

$options = array('ascii' => 'ASCII', 'hex' => 'Hexadecimal', 'dec' => 'Decimal', 'bin' => 'Binary');
loadSyrups('tools.php');
loadModules('stringconvert.php');
pushStyles('stringconvert.css');
pushKeywords('ascii', 'hexadecimal', 'binary', 'decimal', 'converter');
$from = 'ascii';
$to = 'hex';
if (!isempty($_POST['from'])) {
    if (array_key_exists($_POST['from'], $options)) {
        $from = $_POST['from'];
    }
}
if (!isempty($_POST['to'])) {
    if (array_key_exists($_POST['to'], $options)) {
        $to = $_POST['to'];
    }
}
$input = null;
$output = null;
if (!isempty($_POST['input'])) {
    $input = $_POST['input'];
    $output = sc_convert($input, $from, $to);
}
setTitle('String Converter::' . $SP_TITLE);
include ROOT . '/header.php';
?>
<h1>String Converter</h1>
<h2><?php 
echo $options[$from] . ' to ' . $options[$to];
Example #4
0
<?php

loadSyrups('tools.php');
pushKeywords('alphabetical', 'sort');
setTitle('Alphabetical Sorter::' . $SP_TITLE);
pushStyles('sort.css');
$toSort = null;
$sorted = null;
$reverse = false;
if (!isempty($_POST['reverse']) && $_POST['reverse'] == true) {
    $reverse = true;
}
if (!isempty($_POST['toSort'])) {
    $toSort = $_POST['toSort'];
    $sorted = explode("\n", $toSort);
    natcasesort($sorted);
    if ($reverse) {
        $sorted = array_reverse($sorted);
    }
}
include ROOT . '/header.php';
?>
<h1>Alphabetical Sorter</h1>
<p>Sorting a bunch of lines alphabetically is a fairly straightforward task for a computer, but not as easy for a human. Whether it be book titles, names, jobs, or any other kind of list, sometimes having it sorted would be nice, but just takes too much effort. Why not let a computer do it?
<br />
Enter the things you want sorted on the left, separating each one to its own line, and press the sort button in the middle. The sorted list will appear on the right.</p>
<form method="post">
<table>
<tr>
<td><textarea name="toSort" autofocus><?php 
if (!isempty($toSort)) {