Exemple #1
0
    $submit->setAttribute('value', 'Report to admin');
    $name = $dom->createElement('input');
    $name->setAttribute('type', 'hidden');
    $name->setAttribute('name', 'report');
    $name->setAttribute('value', $wb);
    //not really good for performace but ok :)
    $comment = $dom->createElement('input');
    $comment->setAttribute('type', 'text');
    $comment->setAttribute('name', 'comment');
    $comment->setAttribute('value', 'insert a comment here');
    $comment->setAttribute('size', '100');
    $fieldset = $dom->createElement('fieldset');
    $fieldset->appendChild($submit);
    $fieldset->appendChild($name);
    $fieldset->appendChild($comment);
    $form = $dom->createElement('form');
    $form->setAttribute('method', 'POST');
    $form->appendChild($fieldset);
    $body = $dom->getElementsByTagName("body")->item(0);
    $body->insertBefore($form, $body->firstChild);
    echo $dom->saveHTML();
} else {
    $bad = file_get_contents('bad.txt');
    $good = file_get_contents('good.txt');
    $count = floor(file_get_contents('count.txt'));
    $list = WebTest::getVarsList();
    $reslist = WebTest::$reslist;
    $combatCaps = WebTest::$CombatCaps;
    $pricelist = WebTest::$pricelist;
    require 'WebTestGui.html';
}