示例#1
0
文件: form.php 项目: smellems/wet4
//$sim_captcha = new FGSimpleCaptcha('scaptcha');
//$formproc->EnableCaptcha($sim_captcha);
//1. Add your email address here.
//You can add more than one receipients.
$formproc->AddRecipient($email);
//<<---Put your email address here
//2. For better security. Get a random tring from this link: http://tinyurl.com/randstr
// and put it here
$formproc->SetFormRandomKey('CnRrspl1FyEylUj');
$formproc->AddFileUploadField('photo', 'jpg,jpeg,gif,png,pdf,doc,docx,rar.zip,', 5120);
// Get post_max_size and upload_max_filesize
$post_max_size = elgg_get_ini_setting_in_bytes('post_max_size');
$upload_max_filesize = elgg_get_ini_setting_in_bytes('upload_max_filesize');
// Determine the correct value
$max_upload = $upload_max_filesize > $post_max_size ? $post_max_size : $upload_max_filesize;
$upload_limit = elgg_echo('file:upload_limit', array(elgg_format_bytes($max_upload)));
if (isset($_POST['submitted'])) {
    if ($formproc->ProcessForm()) {
        system_messages(elgg_echo('contactform:thankyoumsg'));
        forward("mod/contactform");
        // forward(elgg_get_site_url());
    }
}
?>
<script type='text/javascript' src='scripts/gen_validatorv31.js'></script>

<script>

    $(document).ready(function (){
            $("#reason").change(function() {
                // foo is the id of the other select box 
示例#2
0
<?php

$entity = elgg_extract('entity', $vars);
if ($entity instanceof hypeJunction\Images\Image) {
    $container = $entity->getContainerEntity();
} else {
    $container_guid = elgg_extract('container_guid', $vars);
    $container = get_entity($container_guid);
}
$post_max_size = elgg_get_ini_setting_in_bytes('post_max_size');
$upload_max_filesize = elgg_get_ini_setting_in_bytes('upload_max_filesize');
$max_upload = $upload_max_filesize > $post_max_size ? $post_max_size : $upload_max_filesize;
$upload_limit = elgg_echo('file:upload_limit', [elgg_format_bytes($max_upload)]);
?>
<div class="elgg-text-help">
	<?php 
echo $upload_limit;
?>
</div>
<div>
	<label><?php 
echo elgg_echo('images:file');
?>
</label>
	<?php 
echo elgg_view('input/file', ['name' => 'upload', 'value' => $entity->guid]);
?>
</div>
<div>
	<label><?php 
echo elgg_echo('title');