本文整理汇总了PHP中hidden_input函数的典型用法代码示例。如果您正苦于以下问题:PHP hidden_input函数的具体用法?PHP hidden_input怎么用?PHP hidden_input使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hidden_input函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: afficher_form_rssconf
function afficher_form_rssconf($errors = '')
{
if (!empty($errors)) {
echo erreurs($errors);
}
$out = '';
// Form edit + list feeds.
$out .= '<form id="form-rss-config" method="post" class="bordered-formbloc" action="feed.php?config">' . "\n";
$out .= '<fieldset class="pref">' . "\n";
$out .= '<legend class="legend-link">' . 'Your feeds :' . '</legend>' . "\n";
$out .= '<ul>' . "\n";
foreach ($GLOBALS['liste_flux'] as $i => $flux) {
$out .= "\t" . '<li>' . "\n";
$out .= "\t\t" . '<p ' . ($flux['iserror'] > 2 ? 'class="feed-error" ' : '') . '>' . $flux['title'] . ' ' . ($flux['iserror'] > 2 ? '(' . $flux['iserror'] . ' last requests were errors.)' : '') . '</p>' . "\n";
$out .= "\t\t" . '<div>' . "\n";
$out .= "\t\t" . '<p>' . "\n";
$out .= "\t\t\t" . '<label for="i_' . $flux['checksum'] . '">' . $GLOBALS['lang']['rss_label_titre_flux'] . '</label>' . "\n";
$out .= "\t\t\t" . '<input id="i_' . $flux['checksum'] . '" name="i_' . $flux['checksum'] . '" type="text" class="text" value="' . htmlspecialchars($flux['title']) . '">' . "\n";
$out .= "\t\t" . '</p><p>' . "\n";
$out .= "\t\t\t" . '<label for="j_' . $flux['checksum'] . '">' . $GLOBALS['lang']['rss_label_url_flux'] . '</label>' . "\n";
$out .= "\t\t\t" . '<input id="j_' . $flux['checksum'] . '" name="j_' . $flux['checksum'] . '" type="text" class="text" value="' . htmlspecialchars($flux['link']) . '">' . "\n";
$out .= "\t\t\t" . '<button type="button" class="red-square text" onclick="markAsRemove(this)">' . $GLOBALS['lang']['supprimer'] . '</button>' . "\n";
$out .= "\t\t" . '</p><p>' . "\n";
$out .= "\t\t\t" . '<label for="l_' . $flux['checksum'] . '">' . $GLOBALS['lang']['rss_label_dossier'] . '</label>' . "\n";
$out .= "\t\t\t" . '<input id="l_' . $flux['checksum'] . '" name="l_' . $flux['checksum'] . '" type="text" class="text" value="' . htmlspecialchars($flux['folder']) . '">' . "\n";
$out .= "\t\t" . '<input class="remove-feed nodisplay" name="k_' . $flux['checksum'] . '" type="hidden" value="1">' . "\n";
$out .= "\t\t" . '</div>' . "\n";
$out .= "\t" . '</li>' . "\n";
}
$out .= '</ul>' . "\n";
$out .= '<p class="centrer">' . "\n";
$out .= "\t" . '<input class="submit blue-square" type="submit" name="send" value="' . $GLOBALS['lang']['envoyer'] . '" />' . "\n";
$out .= '</p>' . "\n";
$out .= hidden_input('token', new_token());
$out .= hidden_input('verif_envoi', 1);
$out .= '</fieldset>' . "\n";
$out .= '</form>' . "\n";
// form add new feed.
$out .= '<form id="form-rss-add" method="post" class="bordered-formbloc" action="feed.php?config">' . "\n";
$out .= '<fieldset class="pref">' . "\n";
$out .= '<legend class="legend-link">' . 'Add a feed:' . '</legend>' . "\n";
$out .= "\t\t\t" . '<label for="new-feed">' . 'New Feed :' . '</label>' . "\n";
$out .= "\t\t\t" . '<input id="new-feed" name="new-feed" type="text" class="text" value="" placeholder="http://www.example.org/rss">' . "\n";
$out .= '<p class="centrer">' . "\n";
$out .= "\t" . '<input class="submit blue-square" type="submit" name="send" value="' . $GLOBALS['lang']['envoyer'] . '" />' . "\n";
$out .= '</p>' . "\n";
$out .= hidden_input('token', new_token());
$out .= hidden_input('verif_envoi', 1);
$out .= '</fieldset>' . "\n";
$out .= '</form>' . "\n";
return $out;
}
示例2: foreach
echo '<th></th></tr>';
echo '<tr>';
echo '<td class="none" colspan="4" >';
echo '</td>';
echo '</tr>';
if (!empty($Messages)) {
foreach ($Messages as $Message) {
extract(stripslashes_r($Message));
$ID = get_db('request_mail', $Message);
if (!empty($ID)) {
$Transmitter = $ID['Account_Pseudo'];
echo "<tr><td>{$Transmitter}</td>";
echo "<td>{$Private_Message_Subject}</td>";
echo "<td>" . bb_code($Private_Message_Message) . "</td>";
echo '<td>';
echo formulaire_input(array(hidden_input("Private_Message_ID", $Private_Message_ID), hidden_input("Private_Message_Conversation", $Private_Message_Conversation), hidden_input("Transmitter", $Transmitter), hidden_input("Message_Subject", $Private_Message_Subject), hidden_input("Message", nl2br($Private_Message_Message)), submit_input("Reply", "btn.message.reply"), submit_input("Delete", "btn.message.delete")), "Mailbox-Send-{$Private_Message_ID}", get_link('Mailbox', 'User'), "post", null);
echo '</td></tr>';
echo '<tr>';
echo '<td class="none" colspan="4" >';
echo '</td>';
echo '</tr>';
}
}
}
echo "</table>";
echo '<p>';
echo '<a href="' . get_link('Mailbox', 'User', array("Write" => "mail")) . '">' . LanguageValidation::nMsg("btn.message.write") . '</a>';
echo '</p>';
if (empty($Private_Message_ID)) {
echo 'Vous n\'avez aucun nouveau message';
}
示例3: afficher_form_commentaire
function afficher_form_commentaire($article_id, $mode, $erreurs = '', $comm_id = '')
{
$GLOBALS['form_commentaire'] = '';
$p_auteur = isset($_POST['auteur']) ? protect($_POST['auteur']) : '';
$p_email = isset($_POST['email']) ? protect($_POST['email']) : '';
$p_webpage = isset($_POST['webpage']) ? protect($_POST['webpage']) : '';
$p_comm = isset($_POST['commentaire']) ? protect($_POST['commentaire']) : '';
if (isset($_POST['_verif_envoi']) and !empty($erreurs)) {
$GLOBALS['form_commentaire'] = '<div id="erreurs"><strong>' . $GLOBALS['lang']['erreurs'] . '</strong> :' . "\n";
$GLOBALS['form_commentaire'] .= '<ul><li>' . "\n";
$GLOBALS['form_commentaire'] .= implode('</li><li>', $erreurs);
$GLOBALS['form_commentaire'] .= '</li></ul></div>' . "\n";
$defaut = array('auteur' => $p_auteur, 'email' => $p_email, 'webpage' => $p_webpage, 'commentaire' => $p_comm);
} elseif (isset($mode) and $mode == 'admin') {
if (empty($comm_id)) {
$defaut = array('auteur' => $GLOBALS['auteur'], 'email' => $GLOBALS['email'], 'webpage' => $GLOBALS['racine'], 'commentaire' => '');
} else {
$actual_comment = $comm_id;
$defaut = array('auteur' => protect($actual_comment['bt_author']), 'email' => protect($actual_comment['bt_email']), 'webpage' => protect($actual_comment['bt_webpage']), 'commentaire' => htmlspecialchars($actual_comment['bt_wiki_content']), 'status' => protect($actual_comment['bt_statut']));
}
} elseif (isset($_POST['previsualiser'])) {
// parses the comment, but does not save it in a file
$defaut = array('auteur' => $p_auteur, 'email' => $p_email, 'webpage' => $p_webpage, 'commentaire' => $p_comm);
$comm['bt_content'] = formatage_commentaires($p_comm);
$comm['bt_id'] = date('YmdHis');
$comm['bt_author'] = $p_auteur;
$comm['bt_email'] = $p_email;
$comm['bt_webpage'] = $p_webpage;
$comm['anchor'] = article_anchor($comm['bt_id']);
$comm['bt_link'] = '';
$comm['auteur_lien'] = $comm['bt_webpage'] != '' ? '<a href="' . $comm['bt_webpage'] . '" class="webpage">' . $comm['bt_author'] . '</a>' : $comm['bt_author'];
$GLOBALS['form_commentaire'] .= '<div id="erreurs"><ul><li>Prévisualisation :</li></ul></div>' . "\n";
$GLOBALS['form_commentaire'] .= '<div id="previsualisation">' . "\n";
$GLOBALS['form_commentaire'] .= conversions_theme_commentaire(file_get_contents($GLOBALS['theme_post_comm']), $comm);
$GLOBALS['form_commentaire'] .= '</div>' . "\n";
} else {
if (isset($_POST['_verif_envoi'])) {
header('Location: ' . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'] . '#top');
// redirection anti repostage;
}
$auteur_c = isset($_COOKIE['auteur_c']) ? protect($_COOKIE['auteur_c']) : '';
$email_c = isset($_COOKIE['email_c']) ? protect($_COOKIE['email_c']) : '';
$webpage_c = isset($_COOKIE['webpage_c']) ? protect($_COOKIE['webpage_c']) : '';
$defaut = array('auteur' => $auteur_c, 'email' => $email_c, 'webpage' => $webpage_c, 'commentaire' => '', 'captcha' => '');
}
// prelim vars for Generation of comment Form
$required = $GLOBALS['require_email'] == 1 ? 'required=""' : '';
$cookie_checked = (isset($_COOKIE['cookie_c']) and $_COOKIE['cookie_c'] == 1) ? ' checked="checked"' : '';
$subscribe_checked = (isset($_COOKIE['subscribe_c']) and $_COOKIE['subscribe_c'] == 1) ? ' checked="checked"' : '';
// COMMENT FORM ON ADMIN SIDE : +always_open –captcha –previsualisation –verif
if ($mode == 'admin') {
$rand = substr(md5(rand(100, 999)), 0, 5);
// begin with some additional stuff on comment "edit".
if (isset($actual_comment)) {
// edit
$form = "\n" . '<form id="form-commentaire-' . $actual_comment['bt_id'] . '" class="form-commentaire" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'] . '#erreurs">' . "\n";
$form .= "\t" . '<div class="comm-edit-hidden-bloc">' . "\n";
$form .= "\t" . '<fieldset class="syst">' . "\n";
$form .= "\t\t" . hidden_input('is_it_edit', 'yes');
$form .= "\t\t" . hidden_input('comment_id', $actual_comment['bt_id']);
$form .= "\t\t" . hidden_input('status', $actual_comment['bt_statut']);
$form .= "\t\t" . hidden_input('ID', $actual_comment['ID']);
$form .= "\t\t" . hidden_input('token', $actual_comment['comm-token']);
$form .= "\t" . '</fieldset><!--end syst-->' . "\n";
} else {
$form = "\n" . '<form id="form-commentaire" class="form-commentaire" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'] . '#erreurs" >' . "\n";
}
$form .= "\t" . '<fieldset class="field">' . "\n";
$form .= "\t\t" . hidden_input('comment_article_id', $article_id);
$form .= "\t" . '<p class="formatbut">' . "\n";
$form .= "\t\t" . '<button id="button01" class="but" type="button" title="' . $GLOBALS['lang']['bouton-gras'] . '" onclick="insertTag(\'[b]\',\'[/b]\',\'commentaire' . $rand . '\');"><span></span></button>' . "\n";
$form .= "\t\t" . '<button id="button02" class="but" type="button" title="' . $GLOBALS['lang']['bouton-ital'] . '" onclick="insertTag(\'[i]\',\'[/i]\',\'commentaire' . $rand . '\');"><span></span></button>' . "\n";
$form .= "\t\t" . '<button id="button03" class="but" type="button" title="' . $GLOBALS['lang']['bouton-soul'] . '" onclick="insertTag(\'[u]\',\'[/u]\',\'commentaire' . $rand . '\');"><span></span></button>' . "\n";
$form .= "\t\t" . '<button id="button04" class="but" type="button" title="' . $GLOBALS['lang']['bouton-barr'] . '" onclick="insertTag(\'[s]\',\'[/s]\',\'commentaire' . $rand . '\');"><span></span></button>' . "\n";
$form .= "\t\t" . '<span class="spacer"></span>' . "\n";
$form .= "\t\t" . '<button id="button09" class="but" type="button" title="' . $GLOBALS['lang']['bouton-lien'] . '" onclick="insertTag(\'[\',\'|http://]\',\'commentaire' . $rand . '\');"><span></span></button>' . "\n";
$form .= "\t\t" . '<button id="button10" class="but" type="button" title="' . $GLOBALS['lang']['bouton-cita'] . '" onclick="insertTag(\'[quote]\',\'[/quote]\',\'commentaire' . $rand . '\');"><span></span></button>' . "\n";
$form .= "\t\t" . '<button id="button12" class="but" type="button" title="' . $GLOBALS['lang']['bouton-code'] . '" onclick="insertTag(\'[code]\',\'[/code]\',\'commentaire' . $rand . '\');"><span></span></button>' . "\n";
$form .= "\t" . '</p><!--end formatbut-->' . "\n";
$form .= "\t\t" . '<textarea class="commentaire text" name="commentaire" required="" placeholder="Lorem Ipsum" id="commentaire' . $rand . '" cols="50" rows="10">' . $defaut['commentaire'] . '</textarea>' . "\n";
$form .= "\t" . '</fieldset>' . "\n";
$form .= "\t" . '<fieldset class="infos">' . "\n";
$form .= "\t\t" . '<label>' . $GLOBALS['lang']['label_dp_pseudo'] . '<input type="text" name="auteur" placeholder="John Doe" required="" value="' . $defaut['auteur'] . '" size="25" class="text" /></label>' . "\n";
$form .= "\t\t" . '<label>' . ($GLOBALS['require_email'] == 1 ? $GLOBALS['lang']['label_dp_email_required'] : $GLOBALS['lang']['label_dp_email']) . '<input type="email" name="email" placeholder="mail@example.com" ' . $required . ' value="' . $defaut['email'] . '" size="25" class="text" /></label>' . "\n";
$form .= "\t\t" . '<label>' . $GLOBALS['lang']['label_dp_webpage'] . '<input type="url" name="webpage" placeholder="http://www.example.com" value="' . $defaut['webpage'] . '" size="25" class="text" /></label>' . "\n";
$form .= "\t\t" . hidden_input('_verif_envoi', '1');
$form .= "\t\t" . hidden_input('token', new_token());
if (isset($actual_comment)) {
// edit
$checked = $actual_comment['bt_statut'] == '0' ? 'checked ' : '';
$form .= "\t" . '<label>' . $GLOBALS['lang']['label_comm_priv'] . '<input type="checkbox" name="activer_comm" ' . $checked . '/></label>' . "\n";
$form .= "\t" . '</fieldset><!--end info-->' . "\n";
$form .= "\t" . '<fieldset class="buttons">' . "\n";
$form .= "\t\t" . hidden_input('ID', $actual_comment['ID']);
$form .= "\t\t" . '<p class="centrer"><input class="submit blue-square" type="submit" name="enregistrer" value="' . $GLOBALS['lang']['envoyer'] . '" /></p>' . "\n";
} else {
$form .= "\t" . '</fieldset><!--end info-->' . "\n";
$form .= "\t" . '<fieldset class="buttons">' . "\n";
$form .= "\t\t" . '<p class="centrer"><input class="submit blue-square" type="submit" name="enregistrer" value="' . $GLOBALS['lang']['envoyer'] . '" /></p>' . "\n";
}
//.........这里部分代码省略.........
示例4: fetch_val
$form = 'source_add';
$focus = 'text';
require "./form_header.php";
// if there's a template for this source group, get it
$template = fetch_val("\n SELECT template\n FROM templates\n WHERE source_fk = {$node}\n ");
$part_type = fetch_val("\n SELECT ch_part_type\n FROM sources\n WHERE source_id = {$node}\n ");
$spt_label = fetch_val("SELECT get_spt_label({$part_type})");
echo "<h2>{$_Add_source} ({$spt_label})</h2>\n";
form_begin($form, $_SERVER['PHP_SELF']);
hidden_input('posted', 1);
source_num_input("{$_Parent_node}:", 'node', $node);
editarea_input("{$_Text}:", 20, 100, 'text', $template);
if (fetch_val("\n SELECT is_leaf FROM source_part_types WHERE part_type_id = {$part_type}\n ") == 't') {
hidden_input('template', false);
hidden_input('part_type', $part_type);
hidden_input('ch_part_type', 0);
} else {
textarea_input('Template:', 3, 100, 'template');
select_source_type('Type:', 'part_type', $part_type);
select_source_type("{$_Subtype}:", 'ch_part_type', 0);
}
text_input("{$_Sort_order}:", 20, 'sort');
text_input("{$_Source_date}:", 20, 'source_date');
form_submit();
form_end();
echo "</body>\n</html>\n";
} else {
$node = $_POST['node'];
$text = rtrim($_POST['text']);
// SMS 20 July 2011: was [$sort = $_POST['sort'] ?: 1;] generated php syntax error if sort was null
$sort = $_POST['sort'] ? $_POST['sort'] : 1;
示例5: fetch_row_assoc
if (!isset($_POST['posted'])) {
$person = $_GET['person'];
$title = "Edit Person {$person}";
require "./form_header.php";
echo "<h2>Rediger person {$person}</h2>\n";
$row = fetch_row_assoc("SELECT * FROM persons WHERE person_id = {$person}");
$gender = $row['gender'];
$given = $row['given'];
$patronym = $row['patronym'];
$toponym = $row['toponym'];
$surname = $row['surname'];
$occupation = $row['occupation'];
$epithet = $row['epithet'];
form_begin('person_insert', $_SERVER['PHP_SELF']);
hidden_input('posted', 1);
hidden_input('person', $person);
radio_gender($gender);
text_input("{$_Given}:", 50, 'given', $given);
text_input("{$_Patronym}:", 50, 'patronym', $patronym);
text_input("{$_Toponym}:", 50, 'toponym', $toponym);
text_input("{$_Surname}:", 50, 'surname', $surname);
text_input("{$_Occupation}:", 50, 'occupation', $occupation);
text_input("{$_Epithet}:", 50, 'epithet', $epithet);
form_submit();
form_end();
echo "</body>\n</html>\n";
} else {
$person = $_POST['person'];
$gender = $_POST['gender'];
$given = $_POST['given'];
$patronym = $_POST['patronym'];
示例6: afficher_form_3
function afficher_form_3($erreurs = '')
{
afficher_html_head('Install');
echo '<div id="axe">' . "\n";
echo '<div id="pageauth">' . "\n";
echo '<h1>' . $GLOBALS['nom_application'] . '</h1>' . "\n";
echo '<h1 id="step">' . $GLOBALS['lang']['install'] . '</h1>' . "\n";
echo erreurs($erreurs);
echo '<form method="post" action="' . basename($_SERVER['PHP_SELF']) . '?' . $_SERVER['QUERY_STRING'] . '">' . "\n";
echo '<div id="install">' . "\n";
echo '<p><label>' . $GLOBALS['lang']['install_choose_sgdb'] . '</label>';
echo '<select id="sgdb" name="sgdb" onchange="show_mysql_form()">' . "\n";
if (extension_loaded('pdo_sqlite')) {
echo "\t" . '<option value="sqlite">SQLite</option>' . "\n";
}
if (extension_loaded('pdo_mysql')) {
echo "\t" . '<option value="mysql">MySQL</option>' . "\n";
}
echo '</select></p>' . "\n";
echo '<div id="mysql_vars" style="display:none;">' . "\n";
if (extension_loaded('pdo_mysql')) {
echo '<p><label for="mysql_user">MySQL User: </label><input type="text" id="mysql_user" name="mysql_user" size="30" value="" class="text" /></p>' . "\n";
echo '<p><label for="mysql_password">MySQL Password: </label><input id="mysql_password" type="password" name="mysql_passwd" size="30" value="" class="text" autocomplete="off" /></p>' . "\n";
echo '<p><label for="mysql_db">MySQL Database: </label><input type="text" id="mysql_db" name="mysql_db" size="30" value="" class="text" /></p>' . "\n";
echo '<p><label for="mysql_host">MySQL Host: </label><input type="text" id="mysql_host" name="mysql_host" size="30" value="" class="text" /></p>' . "\n";
}
echo '</div>' . "\n";
echo '<div id="sqlite_vars">' . "\n";
echo $GLOBALS['lang']['install_sqlite_no_more_todo'];
echo '</div>' . "\n";
echo hidden_input('langue', $GLOBALS['lang']['id']);
echo hidden_input('verif_envoi_3', '1');
echo '<input class="inpauth blue-square" type="submit" name="enregistrer" value="Ok" />' . "\n";
echo '</div>' . "\n";
echo '</form>' . "\n";
}
示例7: form_begin
}
require "./form_header.php";
echo "<h2>{$title}</h2>\n";
form_begin('person_insert', $_SERVER['PHP_SELF']);
hidden_input('posted', 1);
if ($child) {
hidden_input('child', $child);
}
if ($spouse) {
hidden_input('spouse', $spouse);
}
if ($father) {
hidden_input('father', $father);
}
if ($mother) {
hidden_input('mother', $mother);
}
radio_gender($gender);
name_input();
// if we add a spouse, assume that we want to enter a marriage
// event, not a birth event.
$selected = $spouse ? MARR : BIRT;
select_tag($selected);
select_place(0);
date_input();
// text_input("$_Sort_date:", 25, 'sort_date', '');
textarea_input("{$_Text}:", 5, 100, 'event_note', '');
source_input();
text_input("{$_Age}:", 10, 'age', '', "({$_Adds_birth_event})");
form_submit();
form_end();
示例8: fetch_val
require "../settings/settings.php";
require "../functions.php";
require "./forms.php";
require_once "../langs/{$language}.php";
if (!isset($_POST['posted'])) {
$node = $_GET['node'];
$title = "Lag lenke";
$form = 'linkage_add';
$focus = 'text';
$per_id = fetch_val("SELECT COUNT(*) + 1 FROM source_linkage WHERE source_fk={$node}");
require "./form_header.php";
echo "<h2>Lag lenke</h2>\n";
echo '<p>' . fetch_val("SELECT source_text FROM sources WHERE source_id={$node}") . "</p>\n";
form_begin($form, $_SERVER['PHP_SELF']);
hidden_input('posted', 1);
hidden_input('node', $node);
// per_id
text_input("Lnr.: ", 10, 'per_id', $per_id);
// role_fk
select_role();
person_id_input(0, 'person_id', 'Person:');
select_surety();
text_input("Navn i kilden: ", 100, 's_name');
textarea_input("Note: ", 5, 100, 'sl_note');
form_submit();
form_end();
echo "<h3>Personer nevnt i kilden:</h3>\n";
list_mentioned($node, 0);
echo "</body>\n</html>\n";
} else {
$node = $_POST['node'];
示例9: fetch_row_assoc
$level_2 = '';
$level_3 = '';
$level_4 = '';
$level_5 = '';
} else {
$place = fetch_row_assoc("SELECT * FROM places WHERE place_id = {$place_id}");
$level_1 = $place['level_1'];
$level_2 = $place['level_2'];
$level_3 = $place['level_3'];
$level_4 = $place['level_4'];
$level_5 = $place['level_5'];
}
echo "<h2>{$title}</h2>\n";
form_begin('place_edit', $_SERVER['PHP_SELF']);
hidden_input('posted', 1);
hidden_input('place_id', $place_id);
text_input(get_place_desc(1), 80, 'level_1', $level_1);
text_input(get_place_desc(2), 80, 'level_2', $level_2);
text_input(get_place_desc(3), 80, 'level_3', $level_3);
text_input(get_place_desc(4), 80, 'level_4', $level_4);
text_input(get_place_desc(5), 80, 'level_5', $level_5);
form_submit();
form_end();
echo "</body>\n</html>\n";
} else {
$place_id = $_POST['place_id'];
$level_1 = note_to_db($_POST['level_1']);
$level_2 = $_POST['level_2'];
$level_3 = $_POST['level_3'];
$level_4 = $_POST['level_4'];
$level_5 = $_POST['level_5'];
示例10: fetch_row_assoc
$label_en = '';
$label_nb = '';
$is_leaf = 'f';
} else {
$title = "{$_Edit} {$_source_type} #{$spt}";
$spt_row = fetch_row_assoc("\n SELECT\n label_en,\n label_nb,\n description,\n is_leaf\n FROM\n source_part_types\n WHERE\n part_type_id = {$spt}\n ");
$label_en = $spt_row['label_en'];
$label_nb = $spt_row['label_nb'];
$description = $spt_row['description'];
$is_leaf = $spt_row['is_leaf'];
}
require "./form_header.php";
echo "<h2>{$title}</h2>\n";
form_begin('spt_edit', $_SERVER['PHP_SELF']);
hidden_input('posted', 1);
hidden_input('spt', $spt);
text_input("Description:", 80, 'description', $description);
text_input("Label (en):", 40, 'label_en', $label_en);
text_input("Label (nb):", 40, 'label_nb', $label_nb);
select_bool("Is leaf", 'is_leaf', $is_leaf);
form_submit();
form_end();
echo "</body>\n</html>\n";
} else {
$spt = $_POST['spt'];
$description = $_POST['description'];
$label_en = $_POST['label_en'];
$label_nb = $_POST['label_nb'];
$is_leaf = $_POST['is_leaf'];
if ($spt == 0) {
// insert new source part type
示例11: fetch_val
$node = $_GET['node'];
$id = $_GET['id'];
$f_person = $_GET['person'];
$title = "Rediger lenke";
$form = 'linkage_edit';
$focus = 'text';
require "./form_header.php";
echo "<h2>Rediger lenke {$id}</h2>\n";
echo '<p>' . fetch_val("SELECT source_text FROM sources WHERE source_id={$node}") . "</p>\n";
$row = fetch_row_assoc("SELECT * FROM source_linkage WHERE source_fk={$node} AND per_id={$id}");
$person = $row['person_fk'] ? $row['person_fk'] : 0;
form_begin($form, $_SERVER['PHP_SELF']);
hidden_input('posted', 1);
hidden_input('node', $node);
hidden_input('per_id', $id);
hidden_input('f_person', $f_person);
// role_fk
select_role($row['role_fk']);
person_id_input($person, 'person_fk', 'Person: ');
select_surety($row['surety_fk']);
text_input("Navn i kilden: ", 100, 's_name', $row['s_name']);
textarea_input("Note: ", 5, 100, 'sl_note', $row['sl_note']);
form_submit();
form_end();
echo "<h3>Personer nevnt i kilden:</h3>\n";
list_mentioned($node, 0);
echo "</body>\n</html>\n";
} else {
$node = $_POST['node'];
$note = rtrim($_POST['sl_note']);
$f_person = $_POST['f_person'];
示例12: afficher_form_fichier
function afficher_form_fichier($erreurs, $fichiers, $what)
{
// ajout d’un fichier
$max_file_size = taille_formate(min(return_bytes(ini_get('upload_max_filesize')), return_bytes(ini_get('post_max_size'))));
$max_file_nb = ini_get('max_file_uploads');
if ($erreurs) {
echo erreurs($erreurs);
}
$form = '<form id="form-image" class="bordered-formbloc" enctype="multipart/form-data" method="post" action="' . basename($_SERVER['PHP_SELF']) . '" onsubmit="submitdnd(event);">' . "\n";
if (empty($fichiers)) {
// si PAS fichier donnée : formulaire nouvel envoi.
$form .= '<fieldset class="pref" >' . "\n";
$form .= '<div id="form-dragndrop">' . "\n";
$form .= '<div id="dragndrop-area" ondragover="event.preventDefault();" ondrop="handleDrop(event);" >' . "\n";
$form .= "\t" . '<div id="dragndrop-title">' . "\n";
$form .= "\t\t" . $GLOBALS['lang']['img_drop_files_here'] . "\n";
$form .= "\t\t" . '<div class="upload-info">(' . $GLOBALS['lang']['label_jusqua'] . $max_file_size . $GLOBALS['lang']['label_parfichier'] . ')</div>' . "\n";
$form .= "\t" . '</div>' . "\n";
$form .= "\t" . '<div id="file-input-wrapper"><input name="fichier" id="fichier" type="file" required="" /></div>' . "\n";
$form .= "\t" . '<button type="button" class="specify-link white-square" id="click-change-form" onclick="return switchUploadForm();" data-lang-url="' . $GLOBALS['lang']['img_specifier_url'] . '" data-lang-file="' . $GLOBALS['lang']['img_upload_un_fichier'] . '">' . $GLOBALS['lang']['img_specifier_url'] . '</button>' . "\n";
$form .= '</div>' . "\n";
$form .= '<div id="count"></div>' . "\n";
$form .= '<div id="result"></div>' . "\n";
$form .= '</div>' . "\n";
$form .= '<div id="img-others-infos">' . "\n";
$form .= "\t" . '<p><label for="nom_entree">' . $GLOBALS['lang']['label_dp_nom'] . '</label><input type="text" id="nom_entree" name="nom_entree" placeholder="' . $GLOBALS['lang']['placeholder_nom_fichier'] . '" value="" size="60" class="text" /></p>' . "\n";
$form .= "\t" . '<p><label for="description">' . $GLOBALS['lang']['label_dp_description'] . '</label><textarea class="text" id="description" name="description" cols="60" rows="5" placeholder="' . $GLOBALS['lang']['placeholder_description'] . '" ></textarea></p>' . "\n";
$form .= "\t" . '<p><label for="dossier">' . $GLOBALS['lang']['label_dp_dossier'] . '</label><input type="text" id="dossier" name="dossier" placeholder="' . $GLOBALS['lang']['placeholder_folder'] . '" value="" size="60" class="text" /></p>' . "\n";
$form .= "\t" . '<p><label for="statut">' . $GLOBALS['lang']['label_file_priv'] . '<input type="checkbox" id="statut" name="statut"/></label></p>';
$form .= hidden_input('token', new_token(), 'id');
$form .= hidden_input('_verif_envoi', '1');
$form .= "\t" . '<p class="submit-bttns"><input class="submit blue-square" type="submit" name="upload" value="' . $GLOBALS['lang']['img_upload'] . '" /></p>' . "\n";
$form .= '</div>' . "\n";
$form .= '</fieldset>' . "\n";
} elseif (!empty($fichiers) and isset($_GET['file_id']) and preg_match('/\\d{14}/', $_GET['file_id'])) {
$myfile = $fichiers[0];
if ($myfile['bt_type'] == 'image') {
$dossier = $GLOBALS['racine'] . $GLOBALS['dossier_images'] . $myfile['bt_path'];
} else {
$dossier = $GLOBALS['racine'] . $GLOBALS['dossier_fichiers'];
}
$form .= '<div class="edit-fichier">' . "\n";
// codes d’intégrations pour les médias
// Video
if ($myfile['bt_type'] == 'video') {
$form .= '<div class="display-media"><video class="media" src="' . $dossier . '/' . $myfile['bt_filename'] . '" type="video/' . $myfile['bt_fileext'] . '" load controls="controls"></video></div>' . "\n";
}
// image
if ($myfile['bt_type'] == 'image') {
$form .= '<div class="display-media"><a href="' . $dossier . '/' . $myfile['bt_filename'] . '"><img class="media" src="' . $dossier . '/' . $myfile['bt_filename'] . '" alt="' . $myfile['bt_filename'] . '" width="' . $myfile['bt_dim_w'] . '" height="' . $myfile['bt_dim_h'] . '" /></a></div>' . "\n";
}
// audio
if ($myfile['bt_type'] == 'music') {
$form .= '<div class="display-media"><audio class="media" src="' . $dossier . '/' . $myfile['bt_filename'] . '" type="audio/' . $myfile['bt_fileext'] . '" load controls="controls"></audio></div>' . "\n";
}
// la partie listant les infos du fichier.
$form .= '<ul id="fichier-meta-info">' . "\n";
$form .= "\t" . '<li><b>' . $GLOBALS['lang']['label_dp_nom'] . '</b> ' . $myfile['bt_filename'] . '</li>' . "\n";
$form .= "\t" . '<li><b>' . $GLOBALS['lang']['label_dp_type'] . '</b> ' . $myfile['bt_type'] . ' (.' . $myfile['bt_fileext'] . ')</li>' . "\n";
if ($myfile['bt_type'] == 'image') {
// si le fichier est une image, on ajout ses dimensions en pixels
$form .= "\t" . '<li><b>' . $GLOBALS['lang']['label_dp_dimensions'] . '</b> ' . $myfile['bt_dim_w'] . 'px × ' . $myfile['bt_dim_h'] . 'px' . '</li>' . "\n";
}
$form .= "\t" . '<li><b>' . $GLOBALS['lang']['label_dp_date'] . '</b>' . date_formate($myfile['bt_id']) . ', ' . heure_formate($myfile['bt_id']) . '</li>' . "\n";
$form .= "\t" . '<li><b>' . $GLOBALS['lang']['label_dp_poids'] . '</b>' . taille_formate($myfile['bt_filesize']) . '</li>' . "\n";
$form .= "\t" . '<li><b>' . $GLOBALS['lang']['label_dp_checksum'] . '</b>' . $myfile['bt_checksum'] . '</li>' . "\n";
$form .= "\t" . '<li><b>' . $GLOBALS['lang']['label_dp_visibilite'] . '</b>' . ($myfile['bt_statut'] == 1 ? 'Publique' : 'Privée') . '</li>' . "\n";
$form .= '</ul>' . "\n";
// la partie des codes d’intégration (bbcode, etc.)
$form .= '<div id="interg-codes">' . "\n";
$form .= '<p><strong>' . ucfirst('codes d’intégration :') . '</strong></p>' . "\n";
$form .= '<input onfocus="this.select()" class="text" type="text" value=\'' . $dossier . '/' . $myfile['bt_filename'] . '\' />' . "\n";
if ($myfile['bt_type'] == 'image') {
// si le fichier est une image, on ajout BBCode pour [IMG] et le code en <img/>
$form .= '<input onfocus="this.select()" class="text" type="text" value=\'<img src="' . $dossier . '/' . $myfile['bt_filename'] . '" alt="i" width="' . $myfile['bt_dim_w'] . '" height="' . $myfile['bt_dim_h'] . '" style="max-width: 100%; height: auto;" />\' />' . "\n";
$form .= '<input onfocus="this.select()" class="text" type="text" value=\'<img src="/' . $GLOBALS['dossier_images'] . $myfile['bt_path'] . '/' . $myfile['bt_filename'] . '" alt="i" width="' . $myfile['bt_dim_w'] . '" height="' . $myfile['bt_dim_h'] . '" style="max-width: 100%; height: auto;" />\' />' . "\n";
$form .= '<input onfocus="this.select()" class="text" type="text" value=\'<img src="' . $GLOBALS['dossier_images'] . $myfile['bt_path'] . '/' . $myfile['bt_filename'] . '" alt="i" width="' . $myfile['bt_dim_w'] . '" height="' . $myfile['bt_dim_h'] . '" style="max-width: 100%; height: auto;" />\' />' . "\n";
$form .= '<input onfocus="this.select()" class="text" type="text" value=\'[img]' . $dossier . '/' . $myfile['bt_filename'] . '[/img]\' />' . "\n";
$form .= '<input onfocus="this.select()" class="text" type="text" value=\'[spoiler][img]' . $dossier . '/' . $myfile['bt_filename'] . '[/img][/spoiler]\' />' . "\n";
} else {
$form .= '<input onfocus="this.select()" class="text" type="text" value=\'<a href="' . $dossier . '/' . $myfile['bt_filename'] . '" />' . $myfile['bt_filename'] . '</a>\' />' . "\n";
$form .= '<input onfocus="this.select()" class="text" type="text" value=\'[url]' . $dossier . '/' . $myfile['bt_filename'] . '[/url]\' />' . "\n";
}
$form .= '</div>' . "\n";
// la partie avec l’édition du contenu.
$form .= '<div id="img-others-infos">' . "\n";
$form .= "\t" . '<p><label for="nom_entree">' . ucfirst($GLOBALS['lang']['label_dp_nom']) . '</label><input type="text" id="nom_entree" name="nom_entree" placeholder="" value="' . pathinfo($myfile['bt_filename'], PATHINFO_FILENAME) . '" size="60" class="text" /></p>' . "\n";
$form .= "\t" . '<p><label for="description">' . $GLOBALS['lang']['label_dp_description'] . '</label><textarea class="text" name="description" id="description" cols="60" rows="5" placeholder="' . $GLOBALS['lang']['placeholder_description'] . '" >' . $myfile['bt_wiki_content'] . '</textarea></p>' . "\n";
$form .= "\t" . '<p><label for="dossier">' . $GLOBALS['lang']['label_dp_dossier'] . '</label><input type="text" name="dossier" placeholder="' . $GLOBALS['lang']['placeholder_folder'] . '" value="' . (!empty($myfile['bt_dossier']) ? $myfile['bt_dossier'] : '') . '" size="60" class="text" /></p>' . "\n";
$checked = $myfile['bt_statut'] == 0 ? 'checked ' : '';
$form .= "\t" . '<p><label for="statut">' . $GLOBALS['lang']['label_file_priv'] . '<input type="checkbox" id="statut" name="statut" ' . $checked . '/></label></p>';
$form .= "\t" . '<p class="submit-bttns">' . "\n";
$form .= "\t\t" . '<input class="submit red-square" type="button" name="supprimer" value="' . $GLOBALS['lang']['supprimer'] . '" onclick="rmFichier(this)" />' . "\n";
$form .= "\t\t" . '<button class="submit white-square" type="button" onclick="annuler(\'fichiers.php\');">' . $GLOBALS['lang']['annuler'] . '</button>' . "\n";
$form .= "\t\t" . '<input class="submit blue-square" type="submit" name="editer" value="' . $GLOBALS['lang']['envoyer'] . '" />' . "\n";
$form .= "\t" . '</p>' . "\n";
$form .= '</div>' . "\n";
$form .= hidden_input('_verif_envoi', '1');
$form .= hidden_input('is_it_edit', 'yes');
$form .= hidden_input('file_id', $myfile['bt_id']);
//.........这里部分代码省略.........
示例13: fetch_row_assoc
$tag_type = 1;
// single-person by default
} else {
$title = "{$_Edit} {$_event_type} #{$tag}";
$tag_row = fetch_row_assoc("SELECT * FROM tags WHERE tag_id = {$tag}");
$tag_group = $tag_row['tag_group_fk'];
$tag_name = $tag_row['tag_name'];
$gedcom_tag = $tag_row['gedcom_tag'];
$tag_label = $tag_row['tag_label'];
$tag_type = $tag_row['tag_type_fk'];
}
require "./form_header.php";
echo "<h2>{$title}</h2>\n";
form_begin('tag_edit', $_SERVER['PHP_SELF']);
hidden_input('posted', 1);
hidden_input('tag', $tag);
select_tag_group($tag_group);
select_tag_type($tag_type);
text_input("GEDCOM :", 10, 'gedcom_tag', $gedcom_tag);
text_input("Tag name :", 80, 'tag_name', $tag_name);
text_input("Tag label:", 80, 'tag_label', $tag_label);
form_submit();
form_end();
echo "</body>\n</html>\n";
} else {
$tag = $_POST['tag'];
$tag_group = $_POST['tag_group'];
$tag_name = $_POST['tag_name'];
$gedcom_tag = $_POST['gedcom_tag'];
$tag_label = $_POST['tag_label'];
$tag_type = $_POST['tag_type'];
示例14: formulaire_input
if (empty($_POST['Delete']) && empty($_POST['Second_Delete'])) {
echo '<div id="login">';
/**
echo '<form method="POST" action="'.get_link('Delete_Account','User').'"><br />';
echo '<label for="Pseudo">Pseudo</label><input placeholder="Pseudo" type="text" name="Pseudo"><br /><br />';
echo '<label for="Password">Password</label><input placeholder="Mot de passe" type="password" name="Password"><br /><br />';
echo '<input type="submit" name="Second_Delete" value="Suppression">';
echo '<input type="hidden" name="token" value="'.generer_token("Delete_Account-step-1").'"/>';
echo '</form>';
**/
echo formulaire_input(array(text_input("label.login.pseudo", "Pseudo", null, null, null, "placeholder.login.pseudo"), password_input("label.login.password", "Password", null, null, null, "placeholder.login.password"), submit_input("Second_Delete", "btn.delete.account")), "Delete_Account-step-1", get_link('Delete', 'User'), "post", null);
echo '</div>';
}
if (request_confirm('Second_Delete')) {
// $Pseudo = htmlspecialchars(addslashes($_POST['Pseudo']));
// $Password = md5(htmlspecialchars(addslashes($_POST['Password'])));
if (verifier_token(600, get_link('Delete_Account'), 'Delete_Account-step-1')) {
extract(addslashes_r($_POST));
echo "Sans Regret ?<br />";
/** echo '<form method="POST" action="'.get_link('Delete','User').'">';
echo '<input type="hidden" name="Pseudo" value="'.$Pseudo.'"/>';
echo '<input type="hidden" name="Password" value="'.$Password.'"/>';
echo '<input type="submit" name="Back" value="Renoncer">';
echo '<input type="hidden" name="token" value="'.generer_token("Delete_Account-step-2").'"/>';
echo '<input type="submit" name="Delete" value="Suppression">';
echo '</form>';
**/
echo formulaire_input(array(hidden_input("Pseudo", $Pseudo), hidden_input("Password", $Password), submit_input("Back", "btn.back.account"), submit_input("Delete", "btn.delete.account")), "Delete_Account-step-2", get_link('Delete', 'User'), "post", null);
}
}
示例15: legend
echo '<fieldset class="pref valid-center">';
echo legend($GLOBALS['lang']['maintenance_optim'], 'legend-sweep');
echo "\t" . '<p>' . select_yes_no('opti-file', 0, $GLOBALS['lang']['bak_opti_miniature']) . '</p>' . "\n";
if ($GLOBALS['sgdb'] == 'sqlite') {
echo "\t" . '<p>' . select_yes_no('opti-vacu', 0, $GLOBALS['lang']['bak_opti_vacuum']) . '</p>' . "\n";
} else {
echo hidden_input('opti-vacu', 0);
}
echo "\t" . '<p>' . select_yes_no('opti-comm', 0, $GLOBALS['lang']['bak_opti_recountcomm']) . '</p>' . "\n";
echo "\t" . '<p>' . select_yes_no('opti-rss', 0, $GLOBALS['lang']['bak_opti_supprreadrss']) . '</p>' . "\n";
echo '</fieldset>' . "\n";
echo '<p class="submit-bttns">' . "\n";
echo "\t" . '<button class="submit white-square" type="button" onclick="annuler(\'maintenance.php\');">' . $GLOBALS['lang']['annuler'] . '</button>' . "\n";
echo "\t" . '<button class="submit blue-square" type="submit" name="do" value="optim">' . $GLOBALS['lang']['valider'] . '</button>' . "\n";
echo '</p>' . "\n";
echo hidden_input('token', $token);
echo '</form>' . "\n";
// either $do or $file
// $do
} else {
// vérifie Token
if ($erreurs_form = valider_form_maintenance()) {
echo '<div class="bordered-formbloc">' . "\n";
echo '<fieldset class="pref valid-center">' . "\n";
echo legend($GLOBALS['lang']['bak_restor_done'], 'legend-backup');
echo erreurs($erreurs_form);
echo '<p class="submit-bttns"><button class="submit blue-square" type="button" onclick="annuler(\'maintenance.php\')">' . $GLOBALS['lang']['valider'] . '</button></p>' . "\n";
echo '</fieldset>' . "\n";
echo '</div>' . "\n";
} else {
// token : ok, go on !