本文整理汇总了PHP中print_form函数的典型用法代码示例。如果您正苦于以下问题:PHP print_form函数的具体用法?PHP print_form怎么用?PHP print_form使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_form函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: print_mailer
function print_mailer()
{
global $form_name, $form_header, $form_rcpt, $form_thankyou, $form_error, $form_invalid;
if (form_is_posted() && form_is_valid()) {
$name = $_POST['name'];
$mail = $_POST['mail'];
$subj = "=?UTF-8?B?" . base64_encode($form_name) . "?=\n";
$body = make_body();
$head = "From: {$name} ({$_SERVER['REMOTE_ADDR']}) <{$mail}>\n";
$head .= "Reply-To: {$name} <{$mail}>\n";
$head .= "MIME-Version: 1.0\n";
$head .= "Content-Type: text/plain; charset=UTF-8";
if (mail($form_rcpt, $subj, $body, $head)) {
echo $form_thankyou;
} else {
echo $form_error;
print_form();
}
} else {
if (form_is_posted()) {
print_form($form_invalid);
} else {
print_form($form_header);
}
}
}
开发者ID:jsageryd,项目名称:mailer,代码行数:26,代码来源:mailer.php
示例2: category
function category($name, $options, $row)
{
global $var;
$i = 0;
//table name thing goes here
print "<tr>";
print "<td align=center>{$name}</td>";
$container = array();
$container["url"] = "skeleton.php";
$container["body"] = "hall_of_fame_new_detail.php";
$container["category"] = $name;
$container["row"] = $row;
if (isset($var["game_id"])) {
$container["game_id"] = $var["game_id"];
}
print_form($container);
print "<td align=center valign=middle>";
foreach ($options as $print) {
$i++;
list($one, $two) = explode(",", $print);
if (isset($two)) {
print "<input type=hidden name=mod[] value=\"{$print}\">";
}
print_submit($one);
print " ";
if ($i % 3 == 0) {
print "<br>";
}
//unset vars for next sub cat
unset($one, $two);
}
print "</td></form></tr>";
}
开发者ID:smrealms,项目名称:smrv2.0,代码行数:33,代码来源:hall_of_fame_new.php
示例3: process_form
function process_form()
{
//Create variables to store the input
$Name = $_POST['name'];
$Name = htmlspecialchars($Name);
$Email = $_POST['email'];
$Email = htmlspecialchars($Email);
$Comments = $_POST['comments'];
$Comments = htmlspecialchars($Comments);
//If the user did not enter any comments, tell them that they must submit comments and reprint the form
if ($Comments == NULL) {
print_form();
echo "<script> contact_us_fill_fields('{$Name}', '{$Email}');</script>";
echo "<script> contact_us_applyError('textComments'); </script>";
exit;
}
//Email the message to [email protected]
$subject = "Arete Message";
if (!$Name == NULL) {
$subject = "Arete Message from {$Name}";
}
if (Email == NULL) {
$message = $Comments;
} else {
$message = "Email: {$Email}\r\n\r\n{$Comments}";
}
mail("[email protected]", $subject, $message);
echo "\n <header>\n <nav id='navbar'>\n <div class='container'>\n <div id='navLogo' class='nav'>\n <a href='../index.html'><img id='logo' src='../images/logo.png' alt='logo'></a>\n </div>\n <div id='navLinks' class='nav'>\n <ul id='menu'>\n <li><a href='../index.html#aboutUsAnchor'>About Us</a></li>\n <li><a href='../index.html#whatWeDoAnchor'>What We Do</a></li>\n <li><a href='../index.html#resourcesAnchor'>Resources</a></li>\n <li><a href='../index.html#newsAnchor'>News</a></li>\n <li><a href='../index.html#howToHelpAnchor'>How To Help</a></li>\n <li><a href='../index.html#eventsAnchor'>Events</a></li>\n </ul>\n </div>\n <div id='navDonate' class='nav'>\n <a href='#' class='navLink'>Contact Us</a>\n <a href='../Donate/index.php' class='navLink'>Donate</a> \n </div>\n </div>\n </nav>\n </header>\n <section id='contactUsSection' class='row'>\n <h2>Contact Us</h2>\n <h3>Arete EdTech</h3>\n <p><span class='bold'>Phone</span> (314) 603-3555</p>";
if ($Name != NULL) {
echo "<p>Thank you, {$Name}, for your comments! You wrote:</p>";
} else {
echo "<p>Thank you for your comments! You wrote:</p>";
}
echo " <p id='contactUsComments'>{$Comments}</p>\n </section>\n <footer class='gray'>\n <p id='right'>501 c3</p>\n <p>'Let's make a difference and teach children how to code!'</p>\n </footer> ";
END;
}
开发者ID:Arete-EdTech,项目名称:Arete-EdTech.github.io,代码行数:36,代码来源:index.php
示例4: _
$error = true;
$msg_errors[] = _("File type \"" . $_FILES['file_csv']['type'] . "\" not allowed");
}
if (@move_uploaded_file($_FILES["file_csv"]["tmp_name"], $file_csv) == false && !$error) {
$error = true;
$msg_errors[] = empty($msg_errors) ? _("Unable to upload file") : $msg_errors;
}
}
if ($error == false) {
$res = import_assets_csv($file_csv);
}
@unlink($file_csv);
} else {
$msg_errors[] = _("Filename is empty");
}
}
if (isset($res['status']) && !empty($res['file_errors'])) {
$msg_errors[] = $res['file_errors'];
}
print_form($msg_errors);
if (isset($res['status']) && empty($res['file_errors'])) {
print_results($res);
}
?>
</div>
</body>
</html>
开发者ID:jhbsz,项目名称:ossimTest,代码行数:29,代码来源:import_hosts.php
示例5: print_topic
<?php
print_topic("Report a Bug");
print "<span style=\"font-size:75%;\">All information you can see on this page will be sent via email to the developer team!<br>";
print "Be as accurate as possible with your bug description.</span>";
print_form(create_container("bug_report_processing.php", ""));
print "<table>";
print "<tr>";
print "<td style=\"font-weight:bold;\">Login:</td>";
print "<input type=\"hidden\" name=\"login\" value=\"{$account->login}\">";
print "<td>{$account->login}</td>";
print "</tr>";
print "<tr>";
print "<td style=\"font-weight:bold;\">eMail:</td>";
print "<input type=\"hidden\" name=\"email\" value=\"{$account->email}\">";
print "<td>{$account->email}</td>";
print "</tr>";
print "<tr>";
print "<td style=\"font-weight:bold;\">Account ID:</td>";
print "<input type=\"hidden\" name=\"account_id\" value=\"{$account->account_id}\">";
print "<td>{$account->account_id}</td>";
print "</tr>";
print "<tr>";
print "<td style=\"font-weight:bold;\">Subject:</td>";
print "<td><input type=\"text\" name=\"subject\" id=\"InputFields\" style=\"width:300px;\"></td>";
print "</tr>";
print "<tr>";
print "<td style=\"font-weight:bold;\" valign=\"top\">Description:</td>";
print "<td><textarea id=\"InputFields\" name=\"description\" style=\"width:300px;height:100px;\"></textarea></td>";
print "</tr>";
print "<tr>";
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:bug_report.php
示例6: print_topic
<?php
print_topic("SEARCH TRADER");
print "<p> </p>";
print_form(create_container("skeleton.php", "trader_search_result.php"));
print "<span style=\"font-size:75%;\">Player name:</span><br>";
print "<input type=\"text\" name=\"player_name\" id=\"InputFields\" style=\"width:150px\"> ";
print_submit("Search");
print "<p> </p>";
print "<span style=\"font-size:75%;\">Player ID:</span><br>";
print "<input type=\"text\" name=\"player_id\" id=\"InputFields\" style=\"width:50px\"> ";
print_submit("Search");
print "</form>";
开发者ID:smrealms,项目名称:smrv2.0,代码行数:13,代码来源:trader_search.php
示例7: hesk_dbFetchAssoc
if (hesk_dbNumRows($res) == 1) {
/* OK, found in a merged ticket. Get info */
$ticket = hesk_dbFetchAssoc($res);
/* If we require e-mail to view tickets check if it matches the one from merged ticket */
if (hesk_verifyEmailMatch($ticket['trackid'], $my_email, $ticket['email'], 0)) {
hesk_process_messages(sprintf($hesklang['tme'], $trackingID, $ticket['trackid']), 'NOREDIRECT', 'NOTICE');
$trackingID = $ticket['trackid'];
} else {
hesk_process_messages(sprintf($hesklang['tme1'], $trackingID, $ticket['trackid']) . '<br /><br />' . sprintf($hesklang['tme2'], $ticket['trackid']), 'NOREDIRECT', 'NOTICE');
$trackingID = $ticket['trackid'];
print_form();
}
} else {
/* Nothing found, error out */
hesk_process_messages($hesklang['ticket_not_found'], 'NOREDIRECT');
print_form();
}
} else {
/* We have a match, get ticket info */
$ticket = hesk_dbFetchAssoc($res);
/* If we require e-mail to view tickets check if it matches the one in database */
hesk_verifyEmailMatch($trackingID, $my_email, $ticket['email']);
}
/* Ticket exists, clean brute force attempts */
hesk_cleanBfAttempts();
/* Remember email address? */
if ($is_form) {
if (!empty($_GET['r'])) {
setcookie('hesk_myemail', $my_email, strtotime('+1 year'));
$do_remember = ' checked="checked" ';
} elseif (isset($_COOKIE['hesk_myemail'])) {
开发者ID:riansopian,项目名称:hesk,代码行数:31,代码来源:ticket.php
示例8: print_form_title
</div>
<div class="form_section" id="main" style="margin-top:250px">
<div class="inputs_style_2">
<div class="form_title">
<?php
if (function_exists('print_form_title')) {
print_form_title($site_id, $page_type);
}
?>
</div>
<?php
if (function_exists('print_form')) {
print_form($site_id, $page_type, $site_template, '40626947764870', '2');
}
?>
</div>
</div>
</div>
<div class="decription_section">
<h1 class="description_title"><?php
if (function_exists('print_description_title')) {
print_description_title($site_id, $page_type);
}
?>
</h1>
开发者ID:sincco,项目名称:sitios-lineales-inova,代码行数:31,代码来源:registro.php
示例9: generate_form
function generate_form($data)
{
return print_form($data, TRUE);
}
开发者ID:Natolumin,项目名称:observium,代码行数:4,代码来源:search.inc.php
示例10: print_form
<div class="main_section">
<div class="form_section">
<div class="main_banner">
<img src="../general/images/main_banner_3.jpg" />
</div>
<div class="register_form inputs_style_2">
<div class="form_title">
Aprovecha YA este descuento ¡Solo por un tiempo limitado!
</div>
<?php
if (function_exists('print_form')) {
print_form($site_id, $page_type, $site_template, '40994547169873');
}
?>
</div>
</div>
</div>
</div>
<div class="px1000"><div class="decription_section">
<h1 class="description_title">Hurrycane</h1>
<div class="descrption_text"><div class="col_set">
<div class="col_1_2 first">
开发者ID:sincco,项目名称:sitios-lineales-inova,代码行数:31,代码来源:registro.php
示例11: print_errors
print_errors();
print_retry();
} elseif (!check_configs()) {
echo '<p>' . $lang['i_modified'] . '</p>';
print_errors();
} elseif (check_data($_REQUEST['d'])) {
// check_data has sanitized all input parameters
if (!store_data($_REQUEST['d'])) {
echo '<p>' . $lang['i_failure'] . '</p>';
print_errors();
} else {
echo '<p>' . $lang['i_success'] . '</p>';
}
} else {
print_errors();
print_form($_REQUEST['d']);
}
?>
</div>
<div style="clear: both">
<a href="http://dokuwiki.org/"><img src="lib/tpl/default/images/button-dw.png" alt="driven by DokuWiki" /></a>
<a href="http://www.php.net"><img src="lib/tpl/default/images/button-php.gif" alt="powered by PHP" /></a>
</div>
</body>
</html>
<?php
/**
* Print the input form
*/
开发者ID:nextghost,项目名称:dokuwiki,代码行数:31,代码来源:install.php
示例12: print_table
}
print "<br>The government will PAY for the destruction of their ships!";
}
$db->query("SELECT * FROM bounty WHERE game_id = {$player->game_id} AND type = 'HQ' AND claimer_id = 0 ORDER BY amount DESC");
print "<p> </p>";
if ($db->nf()) {
print "<div align=\"center\">Most Wanted by Federal Government</div><br>";
print_table();
print "<tr>";
print "<th>Player Name</th>";
print "<th>Bounty Amount</th>";
print "</tr>";
while ($db->next_record()) {
$id = $db->f("account_id");
$db2->query("SELECT * FROM player WHERE game_id = {$player->game_id} AND account_id = {$id}");
if ($db2->next_record()) {
$name = stripslashes($db2->f("player_name"));
}
$amount = $db->f("amount");
print "<tr>";
print "<td align=\"center\"><font color=yellow>{$name}</font></td>";
print "<td align=\"center\"><font color=red> " . number_format($amount) . " </font></td>";
print "</tr>";
}
print "</table>";
}
if ($player->alignment >= -99 && $player->alignment <= 100) {
print_form(create_container("government_processing.php", ""));
print_submit("Become a deputy");
print "</form>";
}
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:government.php
示例13: restart
restart();
} elseif (isset($_POST['clear_base'])) {
// по кнопке очистить базу очищаем куки
save_for_add('NULL');
restart();
} elseif (isset($_GET['del_ad'])) {
// ловим ключ del_ad в массиве $_GET
$del_id = (int) $_GET['del_ad'];
// присваеиваем его переменной $del_id
if (isset($add[$del_id])) {
// если существует объявление с таким ключом
del_ad($del_id);
//удаляем его
save_for_add($add);
// вызываем save_for_add() и сохраняем массив с объявлениями в файле
restart();
// перезапускаем скрипт
}
} elseif (isset($_GET['click_id'])) {
// действие по клику на объявление
$click_id = (int) $_GET['click_id'];
// присваиваем переменной $click_id номер кликнутого объявления
if (isset($add[$click_id])) {
// если объявление такое существует
print_form($smarty, $add, $add[$click_id]);
// выводим в форму
}
} else {
print_form($smarty, $add);
// иначе выводим пустую форму
}
开发者ID:aic513,项目名称:Web-programming,代码行数:31,代码来源:dz8.php
示例14: print_topic
<?php
print_topic("Delete Album Entry - Confirmation");
print "Are you sure you want to delete your photo album entry and all comments added to it?<br>";
print "This action can't be undone.";
print_form(create_container("album_delete_processing.php", ""));
print_submit("Yes");
print " ";
print_submit("No");
print "</form>";
开发者ID:smrealms,项目名称:smrv2.0,代码行数:10,代码来源:album_delete_confirmation.php
示例15: die
}
if (strlen($sequence) > 1000000) {
die("Error: sequence is too long. Download the script from biophp.org and used it localy.");
}
// when length of query sequence is bellow 4^oligo_len => error (to avoid a lot of 0 frequencies);
if (strlen($sequence) < pow(4, $oligo_len)) {
die("Error: query sequence must be at least 4^(length of oligo) to proceed.");
}
// when frequencies at both strands are requested, place sequence and reverse complement of sequence in one line
if ($strands == 2) {
$sequence .= " " . RevComp($sequence);
}
// compute request and save data in an array
$result = find_oligos($sequence, $oligo_len);
// print the form
print_form($sequence);
//print out results
print "<p>Frequencie of oligos with length {$oligo_len}<br><textarea cols=60 rows=50>";
foreach ($result as $oligo => $frequency) {
print "{$oligo}\t{$frequency}\n";
}
print "\n</textarea>\n";
}
// ######################################################################################################
// ##################################### FUNCTIONS ###################################
// ######################################################################################################
function print_form($sequence)
{
print "<table bgcolor=DDDDFF cellpadding=10><tr><td>\n";
print "<form method=post action=\"" . $_SERVER["PHP_SELF"] . "\">\n";
print "<b>Copy your sequence in the textarea below</b>\n";
开发者ID:biophp,项目名称:biophp,代码行数:31,代码来源:index.php
示例16: init_config
function init_config()
{
function print_form($use_tcp = TRUE, $tcp_host = 'localhost', $tcp_port = '', $unix_socket = '/var/lib/mysql/mysql.sock', $database = 'racktables_db', $username = 'racktables_user', $password = '')
{
echo "<input type=hidden name=save_config value=1>\n";
echo '<h3>Server-side MySQL setup of the database:</h3><div align=left><pre class=trok>';
echo "mysql>\nCREATE DATABASE racktables_db CHARACTER SET utf8 COLLATE utf8_general_ci;\n";
echo "GRANT ALL PRIVILEGES ON racktables_db.* TO racktables_user@localhost IDENTIFIED BY 'MY_SECRET_PASSWORD';\n</pre></div>";
echo '<table>';
echo '<tr><td><label for=conn_tcp>TCP connection</label></td>';
echo '<td><input type=radio name=conn value=conn_tcp id=conn_tcp' . ($use_tcp ? ' checked' : '') . '></td></tr>';
echo '<tr><td><label for=conn_unix>UNIX socket</label></td>';
echo '<td><input type=radio name=conn value=conn_unix id=conn_unix' . ($use_tcp ? '' : ' checked') . '></td></tr>';
echo "<tr><td><label for=mysql_host>TCP host:</label></td>";
echo "<td><input type=text name=mysql_host id=mysql_host value='{$tcp_host}'></td></tr>\n";
echo "<tr><td><label for=mysql_port>TCP port (if not 3306):</label></td>";
echo "<td><input type=text name=mysql_port id=mysql_port value='{$tcp_port}'></td></tr>\n";
echo "<tr><td><label for=mysql_socket>UNIX socket:</label></td>";
echo "<td><input type=text name=mysql_socket id=mysql_socket value='{$unix_socket}'></td></tr>\n";
echo "<tr><td><label for=mysql_db>database:</label></td>";
echo "<td><input type=text name=mysql_db id=mysql_db value='{$database}'></td></tr>\n";
echo "<tr><td><label for=mysql_username>username:</label></td>";
echo "<td><input type=text name=mysql_username id=mysql_username value='{$username}'></td></tr>\n";
echo "<tr><td><label for=mysql_password>password:</label></td>";
echo "<td><input type=password name=mysql_password id=mysql_password value='{$password}'></td></tr>\n";
echo '</table>';
}
global $path_to_secret_php;
if (!is_writable($path_to_secret_php)) {
echo "The {$path_to_secret_php} file is not writable by web-server. Make sure it is.";
echo "The following commands should suffice:<pre>touch '{$path_to_secret_php}'; chmod 666 '{$path_to_secret_php}'</pre>";
echo 'Fedora Linux with SELinux may require this file to be owned by specific user (apache) and/or executing "setenforce 0" for the time of installation. ';
echo 'SELinux may be turned back on with "setenforce 1" command.<br>';
return FALSE;
}
if (!array_key_exists('save_config', $_REQUEST)) {
print_form();
return FALSE;
}
if (empty($_REQUEST['mysql_db']) or empty($_REQUEST['mysql_username'])) {
print_form($_REQUEST['conn'] == 'conn_tcp', $_REQUEST['mysql_host'], $_REQUEST['mysql_port'], $_REQUEST['mysql_socket'], $_REQUEST['mysql_db'], $_REQUEST['mysql_username'], $_REQUEST['mysql_password']);
echo '<h2 class=trerror>Missing database/username parameter!</h2>';
return FALSE;
}
if ($_REQUEST['conn'] == 'conn_tcp' and empty($_REQUEST['mysql_host'])) {
print_form($_REQUEST['conn'] == 'conn_tcp', $_REQUEST['mysql_host'], $_REQUEST['mysql_port'], $_REQUEST['mysql_socket'], $_REQUEST['mysql_db'], $_REQUEST['mysql_username'], $_REQUEST['mysql_password']);
echo '<h2 class=trerror>Missing TCP hostname parameter!</h2>';
return FALSE;
}
if ($_REQUEST['conn'] == 'conn_unix' and empty($_REQUEST['mysql_socket'])) {
print_form($_REQUEST['conn'] == 'conn_tcp', $_REQUEST['mysql_host'], $_REQUEST['mysql_port'], $_REQUEST['mysql_socket'], $_REQUEST['mysql_db'], $_REQUEST['mysql_username'], $_REQUEST['mysql_password']);
echo '<h2 class=trerror>Missing UNIX socket parameter!</h2>';
return FALSE;
}
# finally OK to make a connection attempt
$pdo_dsn = 'mysql:';
switch ($_REQUEST['conn']) {
case 'conn_tcp':
$pdo_dsn .= 'host=' . $_REQUEST['mysql_host'];
if (!empty($_REQUEST['mysql_port']) and $_REQUEST['mysql_port'] != '3306') {
$pdo_dsn .= ';port=' . $_REQUEST['mysql_port'];
}
break;
case 'conn_unix':
$pdo_dsn .= 'unix_socket=' . $_REQUEST['mysql_socket'];
break;
default:
print_form();
echo '<h2 class=trerror>form error</h2>';
return FALSE;
}
$pdo_dsn .= ';dbname=' . $_REQUEST['mysql_db'];
try {
$dbxlink = new PDO($pdo_dsn, $_REQUEST['mysql_username'], $_REQUEST['mysql_password']);
} catch (PDOException $e) {
print_form($_REQUEST['conn'] == 'conn_tcp', $_REQUEST['mysql_host'], $_REQUEST['mysql_port'], $_REQUEST['mysql_socket'], $_REQUEST['mysql_db'], $_REQUEST['mysql_username'], $_REQUEST['mysql_password']);
echo "<h2 class=trerror>Database connection failed. Check parameters and try again.</h2>\n";
echo "PDO DSN: <tt class=trwarning>{$pdo_dsn}</tt><br>";
return FALSE;
}
$conf = fopen($path_to_secret_php, 'w+');
if ($conf === FALSE) {
echo "Error: failed to open {$path_to_secret_php} for writing";
return FALSE;
}
fwrite($conf, "<?php\n# This file has been generated automatically by RackTables installer.\n");
fwrite($conf, "\$pdo_dsn = '{$pdo_dsn}';\n");
fwrite($conf, "\$db_username = '" . $_REQUEST['mysql_username'] . "';\n");
fwrite($conf, "\$db_password = '" . $_REQUEST['mysql_password'] . "';\n\n");
fwrite($conf, <<<ENDOFTEXT
\$user_auth_src = 'database';
\$require_local_account = TRUE;
# Default setting is to authenticate users locally, but it is possible to
# employ existing LDAP or Apache user accounts. Check RackTables wiki for
# more information, in particular, this page for LDAP configuration details:
# http://wiki.racktables.org/index.php?title=LDAP
#\$LDAP_options = array
#(
//.........这里部分代码省略.........
开发者ID:rhysm,项目名称:racktables,代码行数:101,代码来源:install.php
示例17: array
$export_device = $device;
if ($config['snmp']['hide_auth']) {
$params = array('snmp_community', 'snmp_authlevel', 'snmp_authname', 'snmp_authpass', 'snmp_authalgo', 'snmp_cryptopass', 'snmp_cryptoalgo');
foreach ($params as $param) {
if (strlen($export_device[$param])) {
$export_device[$param] = '***';
}
}
}
if ($vars['saveas'] == 'yes' && $vars['filename']) {
download_as_file(gzencode(_json_encode($export_device)), $vars['filename']);
} else {
if ($config['snmp']['hide_auth']) {
print_warning("NOTE, <strong>\$config['snmp']['hide_auth']</strong> is set to <strong>TRUE</strong>, snmp community and snmp v3 auth hidden from output and export.");
} else {
print_error("WARNING, <strong>\$config['snmp']['hide_auth']</strong> is set to <strong>FALSE</strong>, snmp community and snmp v3 auth <strong>NOT hidden</strong> from output and export.");
}
$form = array('type' => 'rows', 'space' => '10px', 'url' => generate_url($vars));
// Filename
$form['row'][0]['filename'] = array('type' => 'text', 'name' => 'Filename', 'value' => $device['hostname'] . '.json.txt.gz', 'width' => '100%', 'placeholder' => TRUE);
// Compress
//$form['row'][0]['compress'] = array(
// 'type' => 'switch',
// 'value' => 1);
// Search button
$form['row'][0]['saveas'] = array('type' => 'submit', 'name' => 'Export', 'icon' => 'icon-save', 'right' => TRUE, 'value' => 'yes');
print_form($form);
r($export_device);
}
unset($export_device, $params, $param);
// EOF
开发者ID:Natolumin,项目名称:observium,代码行数:31,代码来源:data.inc.php
示例18: array
}
if (isset($update_parent)) {
$formdata['update_parent'] = array('type' => 'hidden', 'value' => 1);
}
$formdata['date'] = array('type' => 'datepicker', 'label' => v('CMT_DATE'), 'parent_class' => 'date', 'value' => array('date' => date('d.m.Y', $date), 'time' => date('H:i', $date)));
$formdata['title'] = array('type' => 'text', 'label' => v('CMT_TITLE'), 'style' => array('class' => "col-3_of_7"));
$formdata['content'] = array('type' => 'textarea', 'label' => v('CMT_CONTENT'));
$formdata['c_active'] = array('type' => 'checkbox', 'label' => v('CMT_ACTIVE'));
foreach ($formdata as $key => $val) {
if ($formdata[$key]['type'] == 'checkbox' && !isset($formdata[$key]['settings']['data'])) {
$formdata[$key]['settings']['data'] = array('1' => v('CMT_YES'));
}
if ($val['type'] != 'datepicker') {
if (isset(${$key})) {
$formdata[$key]['value'] = ${$key};
}
if (isset($alert[$key])) {
if (is_array($alert[$key])) {
$formdata[$key]['settings']['alert']['type'] = $alert[$key]['type'];
$formdata[$key]['settings']['alert']['label'] = $alert[$key]['label'];
if (isset($alert[$key]['text'])) {
$formdata[$key]['settings']['alert']['text'] = $alert[$key]['text'];
}
} else {
$formdata[$key]['settings']['alert'] = $alert[$key];
}
}
}
}
print_form($formdata);
print "\n\t\t\t<div class='popup-title'>\n\t\t\t\t<h3> </h3>\n\t\t\t</div><!-- /.popup-title -->\n\t\t\t<div class='form_submit'>\n\t\t\t\t<button type='submit' name='cmt_save' id='submit-form' value='" . v('CMT_BUTTON_SAVE') . "'><i class='icon-save'></i>" . v('CMT_BUTTON_SAVE') . "</button>\n\t\t\t</div>\n\t\t</form>\n\t</div><!-- /.popup-content -->\n</div><!-- /.popup -->";
开发者ID:entire-media,项目名称:comator,代码行数:31,代码来源:engine_cmt_labels.php
示例19: process_form
//.........这里部分代码省略.........
//jobpostdate
if (empty($_POST['jobpostdate'])) {
$errors[] = 'jobpostdate';
}
//jobpostrefreshdate
if (empty($_POST['jobpostrefreshdate'])) {
$errors[] = 'jobpostrefreshdate';
}
// checks for required file
if ($requirefile == "false") {
if ($_FILES['attachment']['error'] == 4) {
$errors[] = 'You forgot to attach your CV';
}
}
//checks attachment file
// checks that we have a file
if (!empty($_FILES["attachment"]) && $_FILES['attachment']['error'] == 0) {
// basename -- Returns filename component of path
$filename = basename($_FILES['attachment']['name']);
$ext = substr($filename, strrpos($filename, '.') + 1);
$filesize = $_FILES['attachment']['size'];
$max_bytes = $max_file_size * 200;
//Check if the file type uploaded is a valid file type.
if (!in_array($ext, $allowtypes)) {
$errors[] = "File <strong>" . $filename . "</strong> has been rejected! Only the following CV formats are allowed: .doc, .docx, .txt, .rtf, and .pdf.";
// check the size of each file
} elseif ($filesize > $max_bytes) {
$errors[] = "Your file: <strong>" . $filename . "</strong> is to big. Max file size is " . $max_file_size . "kb.";
}
}
// if !empty FILES
if (empty($errors)) {
//If everything is OK
// send an email
// Obtain file upload vars
$fileatt = $_FILES['attachment']['tmp_name'];
$fileatt_type = $_FILES['attachment']['type'];
$fileatt_name = $_FILES['attachment']['name'];
// Headers
$headers = "From: {$from}";
// create a boundary string. It must be unique
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
// Add the headers for a file attachment
$headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\"";
// Add a multipart boundary above the plain message
$message = "This is a multi-part message in MIME format.\n\n";
$message .= "--{$mime_boundary}\n";
$message .= "Content-Type: text/html; charset=\"UTF-8\"\n";
$message .= "Content-Transfer-Encoding: 7bit\n\n";
$message .= "JOB TITLE: " . $jobpostsubject . " <br>\n";
$message .= "TOWN CITY: " . $jobpostlocationtowncity . " <br>\n";
$message .= "COUNTY: " . $jobpostlocationcounty . " <br>\n";
$message .= "POST CODE: " . $jobpostpostcode . " <br>\n";
$message .= "JOB TYPE: " . $jobpostjobtype . " <br>\n";
$message .= "SALARY: " . $jobpostsalary . " <br>\n";
$message .= "SECTOR/INDUSTRY: " . $jobpostsectorindustry . " <br>\n";
$message .= "JOB DESCRIPTION : " . $jobpostdescription . " <br>\n";
$message .= "RECRUITER/EMPLOYER: " . $jobpostrecruiteremployer . " <br>\n";
$message .= "CONTACT PERSON: " . $jobpostrecruitercontactperson . " <br>\n";
$message .= "CONTACT NUMBER: " . $jobpostcontactnumber . " <br>\n";
$message .= "EMAIL: " . $jobpostrecruiteremployeremail . " <br>\n";
$message .= "HOW DID YOU HEAR ABOUT US?: " . $jobposthdyhau . " <br>\n";
$message .= ": " . $jobposttermsagree . " <br>\n";
$message .= ": " . $jobpostdate . " <br>\n";
$message .= ": " . $jobpostrefreshdate . " <br>\n\n";
if (is_uploaded_file($fileatt)) {
// Read the file to be attached ('rb' = read binary)
$file = fopen($fileatt, 'rb');
$data = fread($file, filesize($fileatt));
fclose($file);
// Base64 encode the file data
$data = chunk_split(base64_encode($data));
// Add file attachment to the message
$message .= "--{$mime_boundary}\n" . "Content-Type: {$fileatt_type};\n" . " name=\"{$fileatt_name}\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data . "\n\n" . "--{$mime_boundary}--\n";
}
$sql = "INSERT INTO `uk_master_live_job_search` (`JobID`, `jobpostsubject`, `jobpostlocationtowncity`, `jobpostlocationcounty`, `jobpostpostcode`, `jobpostjobtype`, `jobpostsalary`, `jobpostsectorindustry`, `jobpostdescription`, `keywords`, `jobpostrecruiteremployer`, `jobpostrecruitercontactperson`, `jobpostcontactnumber`, `jobpostrecruiteremployeremail`, `jobposthdyhau`, `jobposttermsagree`, `jobpostdate`, `jobpostrefreshdate`,`postjobdatetime`,`startdate`,`enddate`,`jobstatus`,`hits`,`refresh_date`,`last_edit`) VALUES ('0', '{$jobpostsubject}', '{$jobpostlocationtowncity}', '{$jobpostlocationcounty}', '{$jobpostpostcode}', '{$jobpostjobtype}', '{$jobpostsalary}', '{$jobpostsectorindustry}', '{$jobpostdescription}', '{$keywords}', '{$jobpostrecruiteremployer}', '{$jobpostrecruitercontactperson}', '{$jobpostcontactnumber}', '{$jobpostrecruiteremployeremail}', '{$jobposthdyhau}', '{$jobposttermsagree}', '{$jobpostdate}', '{$jobpostrefreshdate}',NOW(),'{$startdate}','{$enddate}','{$jobstatus}','0', NOW(), NOW())";
$rs = mysql_query_with_throw($sql);
// Send the completed message
$envs = array("HTTP_USER_AGENT", "REMOTE_ADDR", "REMOTE_HOST");
foreach ($envs as $env) {
$message .= "{$env}: {$_SERVER[$env]}\n";
}
echo '<div id="formfeedbacktrue"><p>This job has been added to Our Network!</p></div>';
unset($_SESSION['myForm']);
print_form();
// end of if !mail
} else {
//report the errors
echo '<div id="formfeedback"><b><font size="4">WHOOPS! PLEASE REVIEW THE FOLLOWING ISSUES:</font></b>';
foreach ($errors as $msg) {
//prints each error
echo "<ul><li>{$msg}</li></ul>\n";
}
// end of foreach
echo '</div>';
print_form();
}
//end of if(empty($errors))
}
开发者ID:gaurav-kranti-clearmydues,项目名称:uatportalweb,代码行数:101,代码来源:process_post_jobs_form.php
示例20: print_form
<?php
echo print_form('open', 'POST', '', 'edit_form');
$contentType = array('type' => 'text', 'name' => 'content_type', 'id' => 'content_type', 'value' => $oldValues['content_type'], 'placeholder' => 'Content Type', 'label' => '', 'labelFor' => '', 'labelClass' => '', 'mandatory' => TRUE, 'showError' => TRUE, 'error' => isset($errors['content_type']) ? $errors['content_type'] : '');
echo print_field($contentType);
echo print_submit_buttons(array($submit));
echo print_form('close');
开发者ID:VeronaFabLabRepo,项目名称:comune-grezzana-app-backend,
|
请发表评论