本文整理汇总了PHP中currentURL函数的典型用法代码示例。如果您正苦于以下问题:PHP currentURL函数的具体用法?PHP currentURL怎么用?PHP currentURL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了currentURL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
if (loggedIn()) {
new MenuItem(array("name" => "reportThis", "label" => "<i class='icon ion-flag'></i>", "menu" => "header_right", "title" => "Report This", "page" => "reportThis?p=" . currentURL()));
}
new Admintab("reported_content");
}
示例2: prepareRequestUri
function prepareRequestUri()
{
$requestUri = '';
$url = currentURL();
$url_parsed = parse_url($url);
if ($_SERVER['REQUEST_URI']) {
$requestUri = $_SERVER['REQUEST_URI'];
$schemeAndHttpHost = $url_parsed['scheme'] . '://' . $url_parsed['host'] . ':' . $url_parsed['port'];
if (strpos($requestUri, $schemeAndHttpHost) === 0) {
$requestUri = substr($requestUri, strlen($schemeAndHttpHost));
}
}
return $requestUri;
}
示例3: mk_contact_form
function mk_contact_form($atts, $content = null)
{
$html = '<div class="mkcf-wrapper">';
// check for validation errors
if (!empty($_SESSION['mk-validation-errors'])) {
$html .= '<div class="alert-box error">';
$html .= implode('<br />', $_SESSION['mk-validation-errors']);
$html .= '</div>';
// unset validation errors
unset($_SESSION['mk-validation-errors']);
}
$html .= '<form method="post" action="' . currentURL() . '" id="mk-contact-form">';
// name field
$html .= '<div class="input">';
$html .= '<label for="mk-name">Name</label>';
$html .= '<input type="text" class="input-text" id="mk-name" name="mk-name" value="" />';
$html .= '</div>';
// email field
$html .= '<div class="input">';
$html .= '<label for="mk-email">Email</label>';
$html .= '<input type="email" class="input-text" id="mk-email" name="mk-email" value="" />';
$html .= '</div>';
// spam bait field
$html .= '<div class="input" style="display:none;">';
$html .= '<label for="mk-url">URL</label>';
$html .= '<input type="text" class="input-text" id="mk-url" name="url" value="" />';
$html .= '</div>';
// message field
$html .= '<div class="input">';
$html .= '<label for="mk-message">Message</label>';
$html .= '<textarea name="mk-message" rows="5" id="mk-message" class="input-text"></textarea>';
$html .= '</div>';
// submit
$html .= '<div class="input">';
$html .= '<input type="hidden" value="' . encrypt(json_encode($atts), ENCRYPTION_KEY) . '" name="mk-atts" />';
$html .= '<input type="submit" value="Send" name="mk-contact" class="button" />';
$html .= '</div>';
$html .= '</form>';
$html .= '</div>';
return $html;
}
示例4: checkForceLocale
protected function checkForceLocale(Request $request)
{
$allSupportedLocaleCodes = allSupportedLocaleCodes();
$isDirectLocale = in_array($request->segment(1), $allSupportedLocaleCodes);
$forceLocale = $isDirectLocale ? currentLocaleCode() : SettingsFacade::getLocale();
if ($request->has(AppConfig::KEY_FORCE_LOCALE)) {
$forceLocale = $request->input(AppConfig::KEY_FORCE_LOCALE);
}
if (in_array($forceLocale, $allSupportedLocaleCodes)) {
if ($forceLocale != SettingsFacade::getLocale()) {
SettingsFacade::setLocale($forceLocale);
SettingsFacade::storeSession();
SettingsFacade::storeUser();
}
if ($forceLocale != currentLocaleCode()) {
$rdr = redirect(currentURL($forceLocale));
return SettingsFacade::storeCookie($rdr);
}
}
return false;
}
示例5: isset
<?php
$role_name = isset($_POST['role_name']) ? $_POST['role_name'] : '';
if (isset($_POST['submit'])) {
create_role($role_name);
sleep(1);
header('location: ' . currentURL() . '?p=role');
print 'Role created. Click <a href="?p=role">here</a> to view created roles';
}
?>
<form id="form" method="post" action="">
<table>
<tr>
<td><label for="role_name">Role's name:</label></td>
<td><input type="text" name="role_name" size="60" maxlength="128" class="required" /></td>
</tr>
<tr>
<td><input type="submit" name="submit" value="Submit" /></td>
<td><input type="reset" value="Reset" /></td>
</tr>
</table>
</form>
示例6: isset
<?php
$uid = isset($_POST['uid']) ? $_POST['uid'] : '';
$user = user_load($uid);
if (isset($_POST['submit'])) {
delete_user($_POST['id']);
sleep(1);
header('location: ' . currentURL() . '?p=user');
print 'User deleted. Click <a href="?p=user">here</a> to view created users';
}
?>
<h3>Do you want to delete the user "<?php
print $user['User_Username'];
?>
"?</h3>
<form method="post" action="">
<input type="hidden" name="id" value="<?php
print $uid;
?>
"/>
<input type="submit" name="submit" value="Delete" />
<button onclick="history.go(-1);return false;">Cancel</button>
</form>
示例7: array
continue;
}
# Add to array
$toShow[] = array('name' => $name, 'title' => $details['title'], 'checked' => $options[$name] ? ' checked="checked" ' : '');
}
# Prepare variables to pass to template
if ($options['encodePage']) {
$vars['url'] = '';
# Currently visited URL
} else {
$vars['url'] = $URL['href'];
# Currently visited URL
}
$vars['toShow'] = $toShow;
# Options
$vars['return'] = rawurlencode(currentURL());
# Return URL (for clearcookies) (i.e. current URL proxied)
$vars['proxy'] = GLYPE_URL;
# Base URL for proxy directory
# Load the template
$insert = loadTemplate('framedForm.inc', $vars);
# Wrap in enable/disble override to prevent the overriden functions
# affecting anything in the mini-form (like ad codes)
if ($CONFIG['override_javascript']) {
$insert = '<script type="text/javascript">disableOverride();</script>' . $insert . '<script type="text/javascript">enableOverride();</script>';
}
}
# And load the footer
$footer = $CONFIG['footer_include'];
}
# Inject javascript unless sniffed
示例8: currentURL
<td>
<img src="' . currentURL() . 'images/banner_email.png" width="480" height="80" />
</td>
</tr>
<tr style="border: 1px solid black;">
<td>
<p>Hi <b>' . $fullname . '</b></p>
<p>Your new password is: ' . substr($pass, 0, 3) . '***</p>
</td>
</tr>
</table>', 'okms.vietnam@gmail.com');
print '<br/>User edited. Click <a href="?p=home">here</a> to go to home page<br/>';
print 'We sent you an email with your changed account information!';
}
sleep(3);
header('location: ' . currentURL() . '?p=home');
//else print 'This username or email is already taken!';
} else {
print '<span style="color: red;">' . implode('<br />', $err) . '<br/></span>';
$old_name = isset($_POST['name']) ? $_POST['name'] : $user['User_Username'];
$old_fullname = isset($_POST['fullname']) ? $_POST['fullname'] : $user['User_Fullname'];
$old_mail = isset($_POST['mail']) ? $_POST['mail'] : $user['User_Mail'];
$old_rid = isset($_POST['rid']) ? $_POST['rid'] : $user['Role_ID'];
}
}
?>
<form id="form" method="post" action="">
<input type="hidden" name="uid" value="<?php
print $uid;
?>
"/>
示例9: service_description
function service_description($object)
{
$class_name = get_class($object);
$methods = get_class_methods($class_name);
$service = array("sdversion" => "1.0", "name" => "DemoService", "address" => currentURL(), "id" => "urn:md5:" . md5(currentURL()));
$static = get_class_vars($class_name);
foreach ($methods as $method_name) {
$proc = array("name" => $method_name);
$method = new ReflectionMethod($class_name, $method_name);
$params = array();
foreach ($method->getParameters() as $param) {
$params[] = $param->name;
}
$proc['params'] = $params;
$help_str_name = $method_name . "_documentation";
if (array_key_exists($help_str_name, $static)) {
$proc['help'] = $static[$help_str_name];
}
$service['procs'][] = $proc;
}
return $service;
}
示例10: isset
<?php
$cid = isset($_POST['cid']) ? $_POST['cid'] : '';
$code = isset($_POST['code']) ? $_POST['code'] : '';
$name = isset($_POST['name']) ? $_POST['name'] : '';
$new_code = isset($_POST['course_code']) ? $_POST['course_code'] : '';
$new_name = isset($_POST['course_name']) ? $_POST['course_name'] : '';
if (isset($_POST['submit'])) {
edit_course($_POST['cid'], $new_code, $new_name);
sleep(1);
header('location: ' . currentURL() . '?p=course');
print 'Course edited. Click <a href="?p=course">here</a> to view created courses';
}
?>
<form id="form" method="post" action="">
<input type="hidden" name="cid" value="<?php
print $cid;
?>
"/>
<table>
<tr>
<td><label for="course_code">New course's code:</label></td>
<td><input type="text" name="course_code" value="<?php
print $code;
?>
" size="60" maxlength="128" class="required" /></td>
</tr>
<tr>
<td><label for="course_name">New course's name:</label></td>
<td><input type="text" name="course_name" value="<?php
print $name;
示例11: error
function error($type, $allowReload = false)
{
global $phrases, $flag;
// Get extra arguments
$args = func_get_args();
// Remove first argument (we have that as $type)
array_shift($args);
// Check error exists
if (!isset($phrases[$type])) {
// Force to the "unknown" error message
$args = array($type);
$type = 'unknown_error';
}
// If in frame or ajax, don't redirect back to index
if (isset($flag) && ($flag == 'frame' || $flag == 'ajax')) {
// Extra arguments to take care of?
if ($args) {
// Error text must be generated by calling sprintf - we only have
// the extra args as an array so we have to use call_user_func_array
$errorText = call_user_func_array('sprintf', array_merge((array) $phrases[$type], $args));
} else {
// Error text can be fetched simply from the $phrases array
$errorText = $phrases[$type];
}
die($errorText . ' <a href="index.php">Return to index</a>.');
}
// Still here? Not frame so serialize to pass in query string
$pass = $args ? '&p=' . base64_encode(serialize($args)) : '';
// Don't cache the error
sendNoCache();
// Do we want to allow refresh?
$return = $allowReload ? '&return=' . rawurlencode(currentURL()) : '';
// And go to error page
redirect('index.php?e=' . $type . $return . $pass);
exit;
}
示例12: currentScript
<?php
include "settings.php";
include "utilities.php";
$imagefolder = $_SERVER['IMAGE_ROOT'] . $_SERVER['ALBUM_FOLDER'];
$thumbsfolder = $_SERVER['THUMB_ROOT'] . $_SERVER['ALBUM_FOLDER'];
if ($imagefolder == "") {
$imagefolder = ".";
}
echo "<a href='" . currentScript() . "'>home</a>";
if ($_SERVER['ALBUM_FOLDER'] != "") {
echo " > ";
displayHeirarchy($_SERVER['ALBUM_FOLDER']);
}
echo "<br/><br/>";
displayDirectories($imagefolder, $_SERVER['ALBUM_FOLDER']);
echo "<br/>";
displayPageLinks($imagefolder, $rowsperpage, $imagesperrow);
displayThumbs($imagefolder, $thumbsfolder, $thumbsize, $imagesperrow, $rowsperpage);
displayPageLinks($imagefolder, $rowsperpage, $imagesperrow);
/*echo "<br/><br/>";
echo "<a href='".currentScript()."'>home</a>";
if ($albumfolder != "" ) {
echo " > ";
displayHeirarchy($albumfolder);
}*/
echo "<div align='bottom'><a href='" . currentURL() . "/rss.php'><img border='0' src='rsslogo.gif'/></a><font size='2'>Album Feed</font></div>";
示例13: fopen
<?php
include "settings.php";
include "utilities.php";
// get your news items from somewhere, e.g. your database:
$myFile = $_SERVER['RSS_FILE'];
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
fclose($fh);
echo "<rss version='2.0'>";
echo "<channel>";
echo "<title>" . $_SERVER['WEBSITE_TITLE'] . "</title>";
echo "<link>" . currentURL() . "</link>";
echo "<description>" . $_SERVER['WEBSITE_DESCRIPTION'] . "</description>";
preg_match_all("/<album>.*<name>(.*)<\\/name>.*<link>(.*)<\\/link>.*<\\/album>/", $theData, $matches, PREG_SET_ORDER);
$reversedmatches = array_reverse($matches);
$count = 0;
foreach ($reversedmatches as $val) {
writeItem($val[1], $val[2], "");
$count = $count + 1;
if ($count >= $_SERVER['MAX_FEED_ITEMS']) {
break;
}
}
echo "</channel>";
echo "</rss>";
function writeItem($title, $link, $description)
{
echo "<item>";
echo "<title>" . $title . "</title>";
echo "<link>" . $link . "</link>";
示例14: currentURL
<?php
include "settings.php";
include "utilities.php";
$imagefolder = $_SERVER['IMAGE_ROOT'] . $_SERVER['ALBUM_FOLDER'];
$thumbsfolder = $_SERVER['THUMB_ROOT'] . $_SERVER['ALBUM_FOLDER'];
echo "<a href='" . currentURL() . "/view_album.php'>Home</a>";
if ($_SERVER['ALBUM_FOLDER'] != "") {
echo " > ";
displayHeirarchy($_SERVER['ALBUM_FOLDER']);
}
echo "<br/><br/>";
if (!isset($image)) {
echo "Please specify an Image!";
} else {
displayImage($imagefolder, $image, $thumbsfolder, $intermediatesize, TRUE);
}
?>
示例15: fopen
<?php
include "settings.php";
include "utilities.php";
// get your news items from somewhere, e.g. your database:
$myFile = $_SERVER['RSS_FILE'];
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
fclose($fh);
echo "<rss version='2.0'>";
echo "<channel>";
echo "<title>" . $_SERVER['WEBSITE_TITLE'] . "</title>";
echo "<link>" . currentURL() . "</link>";
echo "<description>" . $_SERVER['WEBSITE_DESCRIPTION'] . "</description>";
preg_match_all("/<album>.*<name>(.*)<\\/name>.*<link>(.*)<\\/link>.*<\\/album>/", $theData, $matches, PREG_SET_ORDER);
$reversedmatches = array_reverse($matches);
foreach ($reversedmatches as $val) {
writeItem($val[1], $val[2], "from <a href='" . currentURL() . "'>" . $_SERVER['HTTP_HOST'] . "</a>");
}
echo "</channel>";
echo "</rss>";
function writeItem($title, $link, $description)
{
echo "<item>";
echo "<title>" . $title . "</title>";
echo "<link>" . $link . "</link>";
echo "<description>" . $description . "</description>";
echo "</item>";
}