Aufgrund von Langeweile habe ich in den letzten 45 Minuten an einem PHP-Script gearbeitet. Der Name ist: PHP Script-System. Was macht es? Es vereinfacht das erstellen von kleinen Scripts (z.B. zum Berechnen von physikalischen Werten etc.), indem es einem die Arbeit abnimmt, Formulare zu erstellen. So muss man sich nur noch um die Berechnungen kümmern und nicht mehr um das Formular, das auslesen der Formulareingaben, das wieder Ausgeben der Formulareingaben und um den HTML Code allgemein.
Das Script benutzt die Smarty Template Engine, so dass man das Design leicht anpassen kann. Standardmäßig ist nur ein schlichtes Schwarz auf weiß – Design vorhanden. Außerdem sind drei Beispielscripts vorhanden.
Zum herunterladen HIER klicken. Anleitung ist in der _read.txt zu finden.
Hier ein Beispielscript – example2.phpsys.php:
<?php
// Example 2. Calculate C = Q / U (Capacity = charge / voltage) (i dont know if charge is the right english word for "elektrische Ladung" xD
$script = new ScriptParser();
$script->init('POST');
$script->setNote('You have to define 2 of the variables. The one you want to calculate has to be 0 or left out');
$script->initVar('C', 'Capacity', '', 'C/V or F');
$script->initVar('Q', 'Charge', 50, 'C');
$script->initVar('U', 'Voltage', 25, 'V');
if($script->vars['C'] && $script->vars['Q'] && $script->vars['U'])
$script->addOutput('You have to define exactly 2 variables, not more, not less.');
else
{
if(!$script->vars['C'])
{
if(!$script->vars['Q'] || !$script->vars['U'])
$script->addOutput('You have to define exactly 2 variables, not more, not less.');
else
{
$script->addOutput('Capacity - C = '. $script->vars['Q']/$script->vars['U'] .' Farad');
$script->addNLandOutput(' [ C=Q/U ] ');
}
}
if(!$script->vars['Q'])
{
if(!$script->vars['C'] || !$script->vars['U'])
$script->addOutput('You have to define exactly 2 variables, not more, not less.');
else
{
$script->addOutput('Charge Q = '. $script->vars['C']*$script->vars['U'] .' Q');
$script->addNLandOutput(' [ Q=C*U ] ');
}
}
if(!$script->vars['U'])
{
if(!$script->vars['C'] || !$script->vars['Q'])
$script->addOutput('You have to define exactly 2 variables, not more, not less.');
else
{
$script->addOutput('Charge U = '. $script->vars['Q']/$script->vars['C'] .' V');
$script->addNLandOutput(' [ U=Q/C ] ');
}
}
}
$script->Run();
?>

Very nice mate