예제 #1
0
 function add()
 {
     $input = array('username' => clear_all($_POST['username']), 'content' => clear_all($_POST['content']), 'pro_id' => intval($_GET['id']));
     $this->db->insert_record($this->table, $input);
     $this->db->alert(COMMENT_SUCCESS);
     header_redirect(change_url(full_url()));
 }
예제 #2
0
 function geturl()
 {
     $url = full_url();
     if ($_GET['page']) {
         $url = str_replace('&page=' . $_GET['page'], '', $url);
     }
     return $url;
 }
예제 #3
0
 public static function searchTerms($url = null)
 {
     if (is_null($url)) {
         $url = full_url();
     }
     // if(self::refererIsLocal($url)) return;
     $arr = array();
     parse_str(parse_url($url, PHP_URL_QUERY), $arr);
     return isset($arr['q']) ? $arr['q'] : '';
 }
예제 #4
0
파일: start.php 프로젝트: nachopavon/Elgg
/**
 * Select the correct embed tab for display
 *
 * @param string $hook
 * @param string $type
 * @param array $items
 * @param array $vars
 */
function embed_select_tab($hook, $type, $items, $vars)
{
    $tab_name = array_pop(explode('/', full_url()));
    foreach ($items as $item) {
        if ($item->getName() == $tab_name) {
            $item->setSelected();
            elgg_set_config('embed_tab', $item);
        }
    }
    if (!elgg_get_config('embed_tab') && count($items) > 0) {
        $items[0]->setSelected();
        elgg_set_config('embed_tab', $items[0]);
    }
}
예제 #5
0
 /** Display the requested page. */
 function displayPage($webPage)
 {
     setcookie("last-page", full_url($_SERVER));
     /*if (isset($_SESSION["message"]))
       {
           $message = $_SESSION["message"];
           $this->tpl->assign('message', $message);
           unset($_SESSION["message"]);
       }*/
     $userPermissions = array("USER_VIEW");
     // Use reflexion to get the web page class.
     $className = $webPage . 'Page';
     $phpFile = WEBAPP_DIR . 'pages/' . $webPage . '.php';
     // Try to include (require_once) this PHP file.
     try {
         if (!file_exists($phpFile)) {
             throw new Exception("Page file " . $phpFile . " doesn't exists!", 404);
         }
         require_once 'pages/' . $webPage . '.php';
         if (!class_exists($className)) {
             throw new Exception("Class '" . $className . "' doesn't exists!", 500);
         }
         $o = new $className();
         $o->onCreate();
         $hasPermissions = $o->hasPermissions($userPermissions);
         if (!$hasPermissions) {
             throw new Exception("Vous ne pouvez pas accéder à cette ressource", 403);
         }
         $this->tpl->assign("page", $webPage);
         $o->process($this->tpl);
     } catch (Exception $ex) {
         // Build a basic template.
         $this->tpl->assign("exception", $ex);
         if ($ex->getCode() == 404) {
             $this->tpl->display('404.tpl');
         } else {
             if ($ex->getCode() == 403) {
                 $this->tpl->display('404.tpl');
             } else {
                 $this->tpl->display('500.tpl');
             }
         }
     }
 }
예제 #6
0
 function show_status($input, $id = '', $other = '', $status = '', $top = '', $good = '')
 {
     if ($other != '') {
         $other = '&special=1';
     }
     if ($top != '') {
         $top = '&top=1';
     }
     if ($good != '') {
         $good = '&good=1';
     }
     if ($status != '') {
         $status = '&status=1';
     }
     if ($input == 1) {
         return '<a href="' . full_url() . '&changestatus=' . $id . '&st=' . $input . $other . $top . $good . $status . '"><img width="16px" height="16px" src="images/tick.png" /></a>';
     } else {
         return '<a href="' . full_url() . '&changestatus=' . $id . '&st=' . $input . $other . $top . $good . $status . '"><img width="16px" height="16px" src="images/no-tick.png" /></a>';
     }
 }
});
</script>
<?php 
$category_id = $_REQUEST['category_id'];
$category_name = '{empty}';
$arr_offers = array();
if ($category_id > 0) {
    $offers_stats_array = array();
    $sql = "select id, category_caption, category_name, category_type from tbl_links_categories_list where id='" . mysql_real_escape_string($category_id) . "'";
    $result = mysql_query($sql);
    $row = mysql_fetch_assoc($result);
    if ($row['id'] > 0) {
        $category_name = $row['category_caption'];
    } else {
        // Category id not found
        header("Location: " . full_url() . '?page=links');
        exit;
    }
    switch ($row['category_type']) {
        case 'network':
            $page_type = 'network';
            // Get network ID
            $sql = "select id from tbl_cpa_networks where network_category_name='" . mysql_real_escape_string($row['category_name']) . "'";
            $result = mysql_query($sql);
            $row = mysql_fetch_assoc($result);
            $network_id = $row['id'];
            // Get list of offers from network
            $sql = "select * from tbl_offers where network_id='" . mysql_real_escape_string($network_id) . "' and status=0 order by date_add desc, id asc";
            $result = mysql_query($sql);
            while ($row = mysql_fetch_assoc($result)) {
                $arr_offers[] = $row;
예제 #8
0
        $logline = date('Y-m-d H:i:s') . ' ' . $ip . ' ' . ': ' . print_r($msg, true) . "\n";
    } else {
        $logline = date('Y-m-d H:i:s') . ' ' . $ip . ' ' . ': ' . $msg . "\n";
    }
    error_log($logline, $type, $dest);
}
function my_handler($number, $message, $file, $line)
{
    // jwg
    //	echo 'The following error occurred, allegedly on line ' . $line . ' of file ' . $file . ': ' . $message . ' <br/>';
    //	echo 'The existing variables are:' . print_r($GLOBALS, 1) . '';
    wrtlog("ERROR EXIT: line {$line} of {$file} - {$message}");
    echo '<div style="width:100%;textalign:center;"><table width="80%"><tr><td>There was an error processing your request. See log.</td></tr></table>';
    exit;
}
$actual_link = full_url();
$need_trace = false;
if (version_compare(phpversion(), '5.4.0', '<')) {
    if (session_id() == '') {
        session_start();
    } else {
        $need_trace = true;
    }
} else {
    if (session_status() == PHP_SESSION_NONE) {
        session_start();
    } else {
        $need_trace = true;
    }
}
set_time_limit(0);
예제 #9
0
        create_session();
    } else {
        $debugtrace .= '<br>check2 success';
        $session_data = json_decode($data, true);
    }
}
if ($session_data['ip'] != $_SERVER['REMOTE_ADDR'] || $session_data['ua'] != substr($_SERVER['HTTP_USER_AGENT'], 0, 64)) {
    $debugdata .= '<br>>>cs3 ip=' . ($session_data['ip'] != $_SERVER['REMOTE_ADDR'] ? 't' : 'f') . ' ua=' . ($session_data['ua'] != substr($_SERVER['HTTP_USER_AGENT'], 0, 64) ? 't' : 'f') . '(ipcomp=' . $session_data['ip'] . ' vs ' . $_SERVER['REMOTE_ADDR'] . ' | uacomp=' . $session_data['ua'] . ' vs ' . substr($_SERVER['HTTP_USER_AGENT'], 0, 64) . ' )';
    $debugtrace .= '<br>check3 createonfail';
    create_session();
} else {
    $debugtrace .= '<br>check3 success';
    save_session();
}
if (strlen($debugdata) > 0) {
    $debugdata = '>>>Session Debug Start<<<<br><br>sessionname=' . $session_name . '<br>lifetime=' . $lifetime . '<br>path=' . $path . '<br>domain=' . $domain . '<br>secure=' . ($secure ? 't' : 'f') . '<br>httponly=' . ($httponly ? 't' : 'f') . '<br>hmacalgo=' . $hmac_algo . '<br>expire=' . $expire_time . '<br>sk=' . $sk . '<br>loginurl=' . $login_uri . '<br>uri=' . full_url($_SERVER) . '<br>sid=' . session_id() . '<br><br><pre>session=' . print_r($_SESSION, true) . '</pre><br><br><pre>sessiondata=' . print_r($session_data, true) . '</pre><br>' . $debugdata;
}
$debugtrace .= '<br>>>>TRACE END<<<';
if (!isset($session_data['loggedin'])) {
    $debugdata .= '<br>>>notloggedin';
    $session_data['loggedin'] = false;
}
if ($session_data['loggedin'] == false && substr($_SERVER['REQUEST_URI'], 0, strlen($login_uri)) != $login_uri) {
    $debugdata .= '<br>>>redirect (uricomp=' . substr($_SERVER['REQUEST_URI'], 0, strlen($login_uri)) . ' vs ' . $login_uri . ')';
    if ($session_debug === true) {
        error_reporting($error_reporting_level);
        restore_error_handler();
        die($debugdata . '<br>' . $session_errors . '<br><br>' . $debugtrace . '<br>>>>Session Debug End<<<');
    }
    header("Location: {$login_url}");
    die;
예제 #10
0
<?php

error_reporting(E_ALL);
ini_set('display_errors', 1);
include_once 'parser_api_utility.php';
$completeURL = full_url($_SERVER, true);
$serverName = $_SERVER['SERVER_NAME'];
/*is demo=true */
if (validateParams('demo')) {
    $demo = TRUE;
} else {
    $demo = FALSE;
}
/*is demo=true */
if (validateParams('embedded')) {
    $embedded = TRUE;
} else {
    $embedded = FALSE;
}
/* is API server specified? */
if (validateParams('server')) {
    $server = $_REQUEST['server'];
    if (strcmp($server, 'localhost') === 0) {
        $server = $server . ':8080';
    }
} else {
    if ($demo) {
        $server = "simfel.com";
    } else {
        $server = "communitylive.co";
    }
예제 #11
0
        }
    } else {
        define('CMS_SUBSITE', '');
        define('INVALID_SUBSITE', FALSE);
    }
    // change the environment based on multisite
    define('ENVIRONMENT', CMS_SUBSITE != '' ? 'site-' . CMS_SUBSITE : 'production');
}
// save the subsite to session
if (!isset($_SESSION)) {
    session_start();
}
$_SESSION['__cms_subsite'] = CMS_SUBSITE;
// is subsite is invalid then redirect to the main website.
if (INVALID_SUBSITE || CMS_SUBSITE != '' && !is_dir('./' . $application_folder . '/config/site-' . CMS_SUBSITE)) {
    $address = full_url($_SERVER);
    var_dump($address);
    // determine redirection url
    if (USE_SUBDOMAIN) {
        $address_part = explode('.', $address);
        // get the protocol first
        $protocol = $address_part[0];
        $protocol_part = explode('://', $protocol);
        $protocol = $protocol_part[0] . '://';
        // remove subdomain
        $address_part = array_slice($address_part, 1);
        $address = implode('.', $address_part);
        // add the protocol again
        $address = $protocol . $address;
    } else {
        $address_part = explode('/', $address);
예제 #12
0
파일: index.php 프로젝트: Reeska/restinpi
 $image = preg_match('/(jpg|png|jpeg|gif)$/', $url);
 $js = preg_match('/\\.js$/', $url);
 $css = preg_match('/\\.css$/', $url);
 if ($image) {
     header("Content-Type: image/jpg");
 }
 if ($js) {
     header("Content-Type: application/javascript");
 }
 if ($css) {
     header("Content-Type: text/css");
 }
 /*********************************************************
  * Proxy data
  *********************************************************/
 $proxy = full_url();
 $proxyserv = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . '/rpi/p/';
 /*********************************************************
  * Query
  *********************************************************/
 $server = parse_url($url);
 $hostproxify = $proxyserv . b64_encode($server['scheme'] . '://' . $server['host']);
 $url = html_entity_decode($url);
 if (!($content = http_proxy_query($url))) {
     var_dump($_GET['url']);
     var_dump($url);
     var_dump($content);
 }
 $rewrite = !$image;
 /*********************************************************
  * Rewrite image & script urls
예제 #13
0
파일: product.php 프로젝트: mrj0909/sf
 public function searchresult()
 {
     if (isset($_GET['location_id']) && $_GET['location_id'] != '') {
         $city_id = $_GET['location_id'];
     } else {
         $city_id = '';
     }
     if (isset($_GET['retailer_id']) && $_GET['retailer_id'] != '') {
         $retailer_id = $_GET['retailer_id'];
     } else {
         $retailer_id = '';
     }
     if (isset($_GET['pro_name']) && $_GET['pro_name'] != '') {
         $product_name = $_GET['pro_name'];
     } else {
         $product_name = '';
     }
     //$search_data = array('city_id' => $city_id, 'retailer_id' => $retailer_id, 'product_name' => $product_name);
     //	$this->session->set_userdata($search_data);
     $config['base_url'] = full_url();
     $config['total_rows'] = $this->product_model->searh_form_total($city_id, $retailer_id, $product_name);
     $config['prev_link'] = '&lt; Föregående';
     $config['next_link'] = 'Nästa &gt;';
     $config['per_page'] = 24;
     $config['uri_segment'] = isset($_GET['per_page']) ? $_GET['per_page'] : 0;
     $config['enable_query_strings'] = TRUE;
     $config['page_query_string'] = TRUE;
     $this->pagination->initialize($config);
     $offset = $config['uri_segment'];
     $limit = $config['per_page'];
     $products = $this->product_model->searh_form($city_id, $retailer_id, $product_name, $limit, $offset);
     $product_html = $this->create_product_html($products, 'searchpage');
     //echo  $product_html;
     /*
     $cat_id = 1416;
     		$data['category_name'] = get_categroy_name(149);
     		//$data['product_category']  = get_product_oncategory(149);
     		$data['product_category'] = '';
     		$data['other_choice'] = other_choice_category();
     		$data['related_categories'] = related_categories(149);
     		$data['sales_to_missed'] = sales_not_missed();
     */
     $data['products'] = $product_html;
     $data['total_records'] = $config['total_rows'];
     $data['pagination'] = $this->pagination->create_links();
     $this->template->load('responsive/default', 'responsive/category', $data);
     //$this->output->enable_profiler(TRUE);
 }
예제 #14
0
파일: Laravel.php 프로젝트: pckg/payment
 public function fullUrl($slug, $params = [])
 {
     return full_url($slug, $params);
 }
예제 #15
0
파일: template.php 프로젝트: nathggns/Light
<?php

defined('IN_CMS') or die('No direct access allowed.');
$home = is_postspage();
$url = isset($url) && !$home ? $url : article_url();
$title = isset($title) && !$home ? $title : article_title();
$time = isset($time) && !$home ? $time : article_time();
$excerpt = isset($excerpt) && !$home ? $excerpt : trim(article_description());
$excerpt = $excerpt == "" ? false : $excerpt;
$content = isset($content) && !$home ? $content : article_html();
$image = isset($image) && !$home ? $image : article_custom_field('img', false);
$isArticle = isset($isArticle) && $isArticle;
$uurl = urlencode(full_url());
$utitle = urlencode($title);
$tags = array("theme_url" => theme_url());
foreach ($tags as $s => $r) {
    $content = str_replace("{" . $s . "}", $r, $content);
}
?>
<li class="<?php 
if (isset($first) && $first) {
    echo "showContent";
}
if (!$time) {
    echo " noFooter";
}
echo is_single() ? " single" : " multiple";
?>
">
	<header tabindex="-1">
		<!--<a href="<?php 
예제 #16
0
<?php

$list_id = elgg_extract('list_id', $vars);
$list_options = elgg_extract('list_options', $vars);
$getter_options = elgg_extract('getter_options', $vars);
$offset = abs((int) elgg_extract('offset', $getter_options, 0));
$offset_key = elgg_extract('offset_key', $list_options, 'offset');
$limit_key = elgg_extract('limit_key', $list_options, 'limit');
if (!($limit = (int) elgg_extract('limit', $getter_options, 10))) {
    $limit = get_input($limit_key);
}
$count = (int) elgg_extract('count', $vars, 0);
$base_url = elgg_extract('base_url', $vars, full_url());
$base_url = hj_framework_http_remove_url_query_element($base_url, '__goto');
$num_pages = elgg_extract('num_pages', $vars, 5);
$delta = ceil($num_pages / 2);
if ($count <= $limit && $offset == 0) {
    // no need for pagination
    //return true;
} else {
    $total_pages = ceil($count / $limit);
    $current_page = ceil($offset / $limit) + 1;
    $pages = new stdClass();
    $pages->prev = array('text' => '&laquo; ' . elgg_echo('previous'), 'href' => '', 'is_trusted' => true);
    $pages->next = array('text' => elgg_echo('next') . ' &raquo;', 'href' => '', 'is_trusted' => true);
    $pages->items = array();
    // Add pages before the current page
    if ($current_page > 1) {
        $prev_offset = $offset - $limit;
        if ($prev_offset < 0) {
            $prev_offset = 0;
예제 #17
0
function my_full_theme_url($file = '')
{
    $theme_folder = Config::meta('theme');
    $base = 'themes' . '/' . $theme_folder . '/';
    return full_url($base . ltrim($file, '/'));
}
예제 #18
0
파일: metatags.php 프로젝트: eokyere/elgg
<?php

/**
 * Adds metatags to load Javascript required for the profile
 * 
 * @package ElggProfile
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Curverider Ltd <*****@*****.**>
 * @copyright Curverider Ltd 2008-2009
 * @link http://elgg.com/
 * 
 */
/*
 * <script type="text/javascript" src="<?php echo $vars['url']; ?>pg/iconjs/profile.js" ></script>
 */
?>

	<?php 
if ($owner = page_owner_entity()) {
    ?>
<link rel="meta" type="application/rdf+xml" title="FOAF" href="<?php 
    echo full_url();
    ?>
?view=foaf" /><?php 
}
?>
	
예제 #19
0
    } else {
        $script = str_replace('view=xhr', 'view=default', $script);
    }
    $script = str_replace($lastcached_xhr, $lastcached_default, $script);
    $resources['js'][] = html_entity_decode($script);
}
foreach ($css as $link) {
    if (elgg_is_simplecache_enabled()) {
        $link = str_replace('cache/css/xhr', 'cache/css/default', $link);
    } else {
        $link = str_replace('view=xhr', 'view=default', $link);
    }
    $link = str_replace($lastcached_xhr, $lastcached_default, $link);
    $resources['css'][] = html_entity_decode($link);
}
$params = array('output' => $output, 'status' => 0, 'system_messages' => array('error' => array(), 'success' => array()), 'resources' => $resources, 'href' => full_url());
if (isset($system_messages['success']) && count($system_messages['success'])) {
    $params['system_messages']['success'] = $system_messages['success'];
}
if (isset($system_messages['error']) && count($system_messages['error'])) {
    $params['system_messages']['error'] = $system_messages['error'];
    $params['status'] = -1;
}
$response = json_encode($params);
if (!get_input('X-PlainText-Response')) {
    header("Content-type: application/json");
    print $response;
} else {
    print '<textarea>' . $response . '</textarea>';
    // workaround for IE bugs
}
예제 #20
0
파일: detail.php 프로젝트: akivaron/toko
<?php 
foreach ($detailss as $key => $vdetail) {
    foreach ($kolomm as $kkolomm) {
        ?>
  <div class="form-group">
    <label for="" class="col-sm-2 control-label"><p class="text-left"><?php 
        echo $kkolomm;
        ?>
</p></label>
    <div class="col-sm-10">
    <?php 
        switch ($kkolomm) {
            case 'idimg':
                ?>
    		<a href="<?php 
                echo full_url() . '?img=' . $vdetail[$kkolomm];
                ?>
"><?php 
                echo geturl_img($vdetail[$kkolomm]);
                ?>
</a>
    <?php 
                break;
            default:
                ?>
    		<p class="form-control-static"><?php 
                echo $vdetail[$kkolomm];
                ?>
</p>
    <?php 
                break;
예제 #21
0
/**
 * Helper function for getting the correct new URL with coorect query string separator
 * based on the current URL gotten from full_url() function above. If there are already
 * query strings attached, the pn_note query strings will be applied using '&'.
 * Else they will be added to the current URL using '?'.
 * Source: http://stackoverflow.com/questions/5215684/append-query-string-to-any-form-of-url
 */
function newURL($queryStringToAttach = 'lorem=ipsum')
{
    $absolute_url = full_url($_SERVER);
    $separator = parse_url($absolute_url, PHP_URL_QUERY) == NULL ? '?' : '&';
    $newurl = $absolute_url . $separator . $queryStringToAttach;
    return $newurl;
}
예제 #22
0
 /**
  * Find the menu item that is currently selected
  *
  * @return ElggMenuItem
  */
 protected function findSelected()
 {
     // do we have a selected menu item already
     foreach ($this->menu as $menu_item) {
         if ($menu_item->getSelected()) {
             return $menu_item;
         }
     }
     // scan looking for a selected item
     foreach ($this->menu as $menu_item) {
         if ($menu_item->getHref()) {
             if (elgg_http_url_is_identical(full_url(), $menu_item->getHref())) {
                 $menu_item->setSelected(true);
                 return $menu_item;
             }
         }
     }
     return null;
 }
예제 #23
0
파일: views.php 프로젝트: rasul/Elgg
/**
 * Add the rss link to the extras when if needed
 *
 * @return void
 */
function elgg_views_add_rss_link()
{
    global $autofeed;
    if (isset($autofeed) && $autofeed == true) {
        $url = full_url();
        if (substr_count($url, '?')) {
            $url .= "&view=rss";
        } else {
            $url .= "?view=rss";
        }
        $url = elgg_format_url($url);
        elgg_register_menu_item('extras', array('name' => 'rss', 'text' => elgg_view_icon('rss'), 'href' => $url, 'title' => elgg_echo('feed:rss')));
    }
}
예제 #24
0
    if (is_array($group_podcast_settings)) {
        $podcast_title = $group_podcast_settings['title'];
        $podcast_subtitle = $group_podcast_settings['subtitle'];
        $podcast_description = $group_podcast_settings['description'];
    }
    $podcast_settings_url = "podcasts/group/{$page_owner->guid}/edit";
} else {
    if (elgg_instanceof($page_owner, 'user')) {
        $podcast_title = elgg_get_plugin_user_setting('podcast_title', $page_owner->guid, 'podcasts');
        $podcast_subtitle = elgg_get_plugin_user_setting('podcast_subtitle', $page_owner->guid, 'podcasts');
        $podcast_description = elgg_get_plugin_user_setting('podcast_description', $page_owner->guid, 'podcasts');
        $podcast_settings_url = "podcasts/settings/{$page_owner->username}";
    }
}
$body .= $podcast_subtitle ? "<div class='elgg-subtext'>{$podcast_subtitle}</div>" : '';
$body .= $podcast_description ? "<div class='elgg-output'>{$podcast_description}</div>" : '';
if ($body) {
    echo elgg_view_module('aside', $podcast_title, $body);
}
// Add subscribe link
$podcast_feed_url = full_url();
if (substr_count($podcast_feed_url, '?')) {
    $podcast_feed_url .= "&view=rss";
} else {
    $podcast_feed_url .= "?view=rss";
}
$podcast_feed_url = elgg_format_url($podcast_feed_url);
echo elgg_view('output/url', array('name' => 'podcast_rss', 'text' => elgg_view_icon('rss') . elgg_echo('podcasts:subscribe'), 'href' => $podcast_feed_url, 'class' => 'elgg-podcasts-subscribe-link'));
if ($page_owner && $page_owner->canEdit()) {
    echo elgg_view('output/url', array('text' => elgg_echo('podcasts:editpodcastsettings'), 'href' => $podcast_settings_url, 'class' => 'elgg-button elgg-button-action elgg-podcast-edit-button'));
}
예제 #25
0
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || !empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on') {
    define('PROTOCOL', 'https');
} else {
    define('PROTOCOL', 'http');
}
function full_url($s)
{
    $ssl = !empty($s['HTTPS']) && $s['HTTPS'] == 'on' ? true : false;
    $sp = strtolower($s['SERVER_PROTOCOL']);
    $protocol = substr($sp, 0, strpos($sp, '/')) . ($ssl ? 's' : '');
    $port = $s['SERVER_PORT'];
    $port = !$ssl && $port == '80' || $ssl && $port == '443' ? '' : ':' . $port;
    $host = isset($s['HTTP_X_FORWARDED_HOST']) ? $s['HTTP_X_FORWARDED_HOST'] : isset($s['HTTP_HOST']) ? $s['HTTP_HOST'] : $s['SERVER_NAME'];
    return $protocol . '://' . $host . $port . $s['REQUEST_URI'];
}
$absolute_url = full_url($_SERVER);
echo "<h1>full URL: " . $absolute_url . "</h1><br/>";
echo "<h1>Current protocol: " . PROTOCOL . "</h1><br/>";
echo "<h1>server port: " . $_SERVER['SERVER_PORT'] . "</h1><br/>";
$protocol = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' || $_SERVER['SERVER_PORT'] == 443 ? "https://" : "http://";
echo "<h1>server protocol: " . $_SERVER['SERVER_PROTOCOL'] . "</h1><br/>";
$file = '/storage/www/codebase/apps/book_images/uploads/1366x768/o_18hpad719jcgrvq1maps2i12dbj.jpg';
// 'images/'.$file (physical path)
if (file_exists($file) != FALSE) {
    echo "The file {$file} exists";
} else {
    echo "The file {$file} does not exist";
}
?>
</body>
</html>
예제 #26
0
파일: head.php 프로젝트: duanhv/mdg-social
<?php

/**
 * The standard HTML head
 *
 * @uses $vars['title'] The page title
 */
// Set title
if (empty($vars['title'])) {
    $title = elgg_get_config('sitename');
} else {
    $title = elgg_get_config('sitename') . ": " . $vars['title'];
}
global $autofeed;
if (isset($autofeed) && $autofeed == true) {
    $url = full_url();
    if (substr_count($url, '?')) {
        $url .= "&view=rss";
    } else {
        $url .= "?view=rss";
    }
    $url = elgg_format_url($url);
    $feedref = <<<END

\t<link rel="alternate" type="application/rss+xml" title="RSS" href="{$url}" />

END;
} else {
    $feedref = "";
}
$js = elgg_get_loaded_js('head');
예제 #27
0
파일: pageshell.php 프로젝트: eokyere/elgg
 */
header("Content-Type: text/xml");
echo "<?xml version='1.0'?>\n";
// Set title
if (empty($vars['title'])) {
    $title = $vars['config']->sitename;
} else {
    if (empty($vars['config']->sitename)) {
        $title = $vars['title'];
    } else {
        $title = $vars['config']->sitename . ": " . $vars['title'];
    }
}
// Remove RSS from URL
$url = str_replace('?view=rss', '', full_url());
$url = str_replace('&view=rss', '', full_url());
?>

<rss version='2.0'   xmlns:dc='http://purl.org/dc/elements/1.1/'>
	<channel xml:base=''>
		<title><![CDATA[<?php 
echo $title;
?>
]]></title>
		<link><?php 
echo htmlentities($url);
?>
</link>
		<?php 
echo $vars['body'];
?>
예제 #28
0
 private function notify()
 {
     if ($this->emailOnError === true) {
         $globals = print_r($GLOBALS, true);
         $msg = '';
         $msg .= "Url: " . full_url() . "\n";
         $msg .= "Date: " . dater() . "\n";
         $msg .= "Server: " . $_SERVER['SERVER_NAME'] . "\n";
         $msg .= "ReadDB Error:\n" . mysql_error($this->readDB) . "\n\n";
         $msg .= "WriteDB Error:\n" . mysql_error($this->writeDB) . "\n\n";
         ob_start();
         debug_print_backtrace();
         $trace = ob_get_contents();
         ob_end_clean();
         $msg .= $trace . "\n\n";
         $msg .= $globals;
         mail($this->emailTo, $this->emailSubject, $msg);
     }
     if ($this->onError == 'die') {
         echo "<p style='border:5px solid red;background-color:#fff;padding:5px;'><strong>Read Database Error:</strong><br/>" . mysql_error($this->readDB) . "</p>";
         echo "<p style='border:5px solid red;background-color:#fff;padding:5px;'><strong>Write Database Error:</strong><br/>" . mysql_error($this->writeDB) . "</p>";
         echo "<p style='border:5px solid red;background-color:#fff;padding:5px;'><strong>Last Query:</strong><br/>" . $this->lastQuery() . "</p>";
         echo "<pre>";
         debug_print_backtrace();
         echo "</pre>";
         exit;
     }
     if ($this->onError == 'redirect') {
         redirect($this->errorUrl);
     }
 }
 * @uses $vars['body'] The main content of the page
 * @uses $vars['messages'] A 2d array of various message registers, passed from system_messages()
 */
// Set title
if (empty($vars['title'])) {
    $title = $vars['config']->sitename;
} else {
    if (empty($vars['config']->sitename)) {
        $title = $vars['title'];
    } else {
        $title = $vars['config']->sitename . ": " . $vars['title'];
    }
}
global $autofeed;
if (isset($autofeed) && $autofeed == true) {
    $url = $url2 = full_url();
    if (substr_count($url, '?')) {
        $url .= "&view=rss";
    } else {
        $url .= "?view=rss";
    }
    if (substr_count($url2, '?')) {
        $url2 .= "&view=odd";
    } else {
        $url2 .= "?view=opendd";
    }
    $feedref = <<<END
\t\t\t
\t<link rel="alternate" type="application/rss+xml" title="RSS" href="{$url}" />
\t<link rel="alternate" type="application/odd+xml" title="OpenDD" href="{$url2}" />
\t\t\t
예제 #30
0
>Evil</option>";
                        </select>
                    </td>
                </tr>
                <td style='display:none;'><input type="text" name="grabbed" value="<?php 
    echo $grabbed;
    ?>
"></td>
                <td style='display:none;'>><input type="text" name="using" value=""></td>
            </table>
        </td>
    <td class="outside">
    <center><h1>MentalBlank's AQW Character Builder</h2>
            <a href="http://forum.nothingillegal.com/">NothingIllegal Forums</a> <a href="http://alphafable.info">MentalBlank's Junk</a><br /><br />
            <textarea rows="2" cols="60"><?php 
    echo full_url($_SERVER);
    ?>
</textarea>
    </center>
    <br />
    <characterpreview />
    <script>
        var usingSWF = false;
        document.getElementsByTagName('input')[29].value = "true";
        if (document.getElementsByTagName('input')[28].value == "grabbed") {
            usingSWF = true;
            document.getElementsByTagName('input')[29].value = "true";
            useSWF();
        } else {
            usingSWF = false;
            useDrops();