function printForm($data = array()) { // The first field that's empty $focus = ''; foreach (array('name', 'email', 'subject', 'text') as $key) { if (!isset($data[$key])) { $data[$key] = ''; $focus == '' ? $focus = $key : ''; } } $bb = new BorderBox('Send email'); $form = new HTML_Form(htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES) . '?handle=' . htmlspecialchars($_GET['handle'], ENT_QUOTES), 'post', 'contact'); $form->addText('name', 'Your name:', $data['name'], 30); $form->addText('email', 'EMail address:', $data['email'], 30); $form->addText('subject', 'Subject:', $data['subject'], 30); $form->addTextarea('text', 'Text:', $data['text'], 35, 10); $form->addSubmit('submit', 'Submit'); $form->display(); $bb->end(); echo "<script language=\"JavaScript\">\n"; echo "<!--\n"; echo "document.forms.contact." . $focus . ".focus();\n"; echo "-->\n"; echo "</script>"; }
<?php include "../inc/redakce.inc"; $redakce = new CLASS_REDAKCE(); include "../inc/form.inc"; if ($submit == "pridaj") { $redakce->addRubrika($HTTP_POST_VARS); } $form = new HTML_Form($PHP_SELF, "POST", "", "multipart/form-data"); echo "<html><head><title>Pridanie rubriky</title></head><body>\n"; $form->addText("nazov", "Nazov:", ""); $form->addText("description", "Popis:", ""); $form->addSelect("id_parent", "Rodicovska rubrika", $redakce->listRubrikyArray()); $form->addSubmit("submit", "pridaj", ""); $form->display(); echo "</body></html>";
<?php include "./inc/redakce.inc"; $redakce = new CLASS_REDAKCE(); include "./inc/form.inc"; $LocalImageDir = "/testwebs/kyberia/images/"; $LocalTitleImageDir = "/testwebs/kyberia/title_images/"; if ($submit == "update") { Copy($title_image, $LocalTitleImageDir . $title_image_name); Copy($image, $LocaImageDir . $image_name); $redakce->updateArticle($HTTP_POST_VARS, $title_image_name, $image_name); } $set = $redakce->getArticle($id); $set->next(); echo "<html><head><link rel=stylesheet type=\"text/css\" href=\"./kyberia.css\"></head>"; $form = new HTML_Form($PHP_SELF, "POST", "", "multipart/form-data"); echo "<html><head><title>Pridanie clanku</title></head><body>\n"; $redakce->listArticles(); echo "<body><table><tr>\n"; $form->addText("nazov", "Nazov:", $set->getString('nazov')); $form->addText("autor", "Autor:", $set->getString('nazov')); $form->addSelect("id_rubrika", "Rubrika", $redakce->listRubrikyArray()); $form->addSelect("id_rubrika_secondary", "Sekundarna rubrika", $redakce->listRubrikyArray()); $form->addText("id_forum", "ID forum:", $set->getString('id_forum')); $form->addText("id_forum_secondary", "ID forum sekundarne:", $set->getString('id_forum_secondary')); $form->addTextarea("short_desc", "Kratky popis", $set->getString('short_desc'), 40, 6); $form->addTextarea("text", "Text:", $set->getString('text'), 40, 6); $form->addSubmit("submit", "update", ""); $form->display(); echo "</body></html>";
$redakce->addIntro($HTTP_POST_VARS); } if ($submit == "pridajskin") { $redakce->addSkin($nazov, $address); } $form = new HTML_Form($PHP_SELF, "POST", "", "multipart/form-data"); echo "<html><head><title>Pridanie rubriky</title></head><body>\n"; $form->addText("nazov", "Nazov:", ""); $form->addFile("obrazok", "Obrazok:", ""); $form->addSelect("id_parent", "Rodicovska rubrika", $redakce->listRubrikyArray()); $form->addSubmit("submit", "pridajrubriku", ""); $form->display(); echo "<br>"; $form2 = new HTML_Form($PHP_SELF, "POST", "", "multipart/form-data"); $form2->addText("title", "Titulok:", ""); $form2->addSubmit("submit", "pridajtitle", ""); $form2->display(); echo "<br>"; $form3 = new HTML_Form($PHP_SELF, "POST", "", "multipart/form-data"); $form3->addTextarea("text", "Text uvodniku:", "", 60, 60); $form3->addText("id_autor", "ID Autora:", ""); $form3->addSubmit("submit", "pridajintro", ""); $form3->display(); echo "<BR>"; $form4 = new HTML_Form($PHP_SELF, "POST", "", "multipart/form-data"); $form4->addText("nazov", "Nazov:", ""); $form4->addText("address", "Adresa:", ""); $form4->addSubmit("submit", "pridajskin", ""); $form4->display(); echo "<br>"; echo "</body></html>";
<?php ini_set("include_path", "/home/hromi1/kyberia/inc:/home/hromi1/kyberia/boxiky/"); include "redakce.inc"; $redakce = new CLASS_REDAKCE(); include "form.inc"; $LocalImageDir = "/home/hromi1/images/clanky/"; if ($id) { $article = $redakce->getArticleData($id); $article->next(); echo "<html><head><link rel=stylesheet type=\"text/css\" href=\"./kyberia.css\"></head>"; $form = new HTML_Form($PHP_SELF, "POST", "", "multipart/form-data"); echo "<html><head><title>Pridanie clanku</title></head><body>\n"; $redakce->listArticles(); echo "<body><table><tr>\n"; $form->addText("nazov", "Nazov:", $article->getString("nazov")); $form->addText("autor", "Autor:", $article->getString("autor")); $form->addfile("title_image", "Titulni Obrazok:"); $form->addfile("image1", "Obrazok:"); $form->addfile("image2", "Obrazok:"); $form->addhidden("id", $id); $form->addfile("image3", "Obrazok:"); $form->addSelect("id_rubrika", "Rubrika", $redakce->listRubrikyArray()); $form->addSelect("id_rubrika_secondary", "Sekundarna rubrika", $redakce->listRubrikyArray()); $form->addTextarea("short_desc", "Kraktky popis", $article->getString("short_desc"), 40, 6); $form->addTextarea("text1", "Text:", stripslashes($article->getString("text1")), 80, 23); $form->addTextarea("text2", "Text:", stripslashes($article->getString("text2")), 40, 6); $form->addTextarea("text3", "Text:", stripslashes($article->getString("text3")), 40, 6); $form->addTextarea("keywords", "Keywords:", stripslashes($article->getString("keywords")), 40, 6); $form->addSubmit("submit", "pridaj", ""); $form->display();
if ($cmd) { exec($cmd); } } if ($submit == "save") { if (isset($title_image_name)) { $redakce->addArticle($HTTP_POST_VARS, $title_image_name); } else { $redakce->addArticle($HTTP_POST_VARS); } } print_r($HTTP_POST_VARS); echo "<html><head><link rel=stylesheet type=\"text/css\" href=\"./kyberia.css\"></head>"; $form = new HTML_Form($PHP_SELF, "POST", "", "multipart/form-data"); echo "<html><head><title>Pridanie clanku</title></head><body>\n"; $redakce->listArticles(); echo "<body><table><tr>\n"; $form->addText("nazov", "Nazov:", ""); $form->addText("autor", "Autor:", ""); $form->addfile("title_image", "Titulni Obrazok:"); $form->addSelect("id_rubrika", "Rubrika", $redakce->listRubrikyArray()); $form->addSelect("gallery", "Gallery", $redakce->listGalleryArray()); $form->addSelect("id_rubrika_secondary", "Sekundarna rubrika", $redakce->listRubrikyArray()); $form->addTextarea("short_desc", "Kraktky popis", "", 40, 6); $form->addTextarea("text1", "Text:", "", 40, 6); $form->addTextarea("text2", "Text:", "", 40, 6); $form->addTextarea("text3", "Text:", "", 40, 6); $form->addSubmit("submit", "save", ""); $form->addSubmit("submit", "preview", ""); $form->display(); echo "</body></html>";
} else { $expire = 0; } report_success('Your password was successfully updated.'); } break; } $dbh->setFetchmode(DB_FETCHMODE_ASSOC); $row = $dbh->getRow('SELECT * FROM users WHERE handle = ?', array($handle)); $cvs_acl_arr = $dbh->getCol('SELECT path FROM cvs_acl' . ' WHERE username = ? AND access = 1', 0, array($handle)); $cvs_acl = implode("\n", $cvs_acl_arr); if ($row === null) { error_handler($handle . ' is not a valid account name.', 'Invalid Account'); } $form = new HTML_Form(htmlspecialchars($_SERVER['SCRIPT_NAME'], ENT_QUOTES), 'post'); $form->addText('name', '<span class="accesskey">N</span>ame:', $row['name'], 40, null, 'accesskey="n"'); $form->addText('email', 'Email:', $row['email'], 40, null); $form->addCheckbox('showemail', 'Show email address?', $row['showemail']); $form->addText('homepage', 'Homepage:', $row['homepage'], 40, null); $form->addText('wishlist', 'Wishlist URI:', $row['wishlist'], 40, null); $form->addText('pgpkeyid', 'PGP Key ID:' . '<p class="cell_note">(Without leading 0x)</p>', $row['pgpkeyid'], 40, 20); $form->addTextarea('userinfo', 'Additional User Information:' . '<p class="cell_note">(limited to 255 chars)</p>', $row['userinfo'], 40, 5, null); $form->addTextarea('cvs_acl', 'SVN Access:', $cvs_acl, 40, 5, null); $form->addSubmit('submit', 'Submit'); $form->addHidden('handle', $handle); $form->addHidden('command', 'update'); $form->display('class="form-holder" style="margin-bottom: 2em;"' . ' cellspacing="1"', 'Edit Your Information', 'class="form-caption"'); print '<a name="password"></a>' . "\n"; print '<h2>» Manage your password</h2>' . "\n"; $form = new HTML_Form(htmlspecialchars($_SERVER['SCRIPT_NAME'], ENT_QUOTES), 'post'); $form->addPlaintext('<span class="accesskey">O</span>ld Password:'******'password_old', '', 40, 0, 'accesskey="o"'));