本文整理汇总了PHP中Request::Get方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::Get方法的具体用法?PHP Request::Get怎么用?PHP Request::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Request
的用法示例。
在下文中一共展示了Request::Get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Verify
public static function Verify()
{
// Retrieve
$DB = GetDB();
$captcha = $DB->Row('SELECT * FROM # WHERE `session`=?', array(self::TABLE, $_COOKIE[self::COOKIE]));
// Validate
$v = Validator::Create();
$v->Register(!empty($captcha) && strtoupper($captcha['code']) == strtoupper(Request::Get('captcha')), Validator_Type::IS_TRUE, _T('Validation:Invalid Captcha'));
// Remove
$DB->Update('DELETE FROM # WHERE `session`=?', array(self::TABLE, $_COOKIE[self::COOKIE]));
setcookie(self::COOKIE, null, time() - self::EXPIRES, Config::Get('cookie_path'), Config::Get('cookie_domain'));
}
示例2: sendWordsAction
public function sendWordsAction($data = array())
{
$req = new Request();
$doc = new Document($req->Get('docId'));
$doc->saveWords($req->Get('words'));
$data = array('docId' => $doc->getId(), 'docWords' => $doc->getWords());
return json_encode($data);
}
示例3: GenerateFromCustom
public static function GenerateFromCustom($type)
{
$DB = GetDB();
$schema = GetDBSchema();
$xtable = $schema->el('//table[naming/type="' . $type . '"]');
$primary_key = $xtable->columns->primaryKey->val();
$custom_schema_table = $xtable->custom->val() . '_schema';
$html = '';
$result = $DB->Query('SELECT * FROM # ORDER BY `field_id`', array($custom_schema_table));
while ($field = $DB->NextRow($result)) {
switch ($field['type']) {
case self::TEXT:
$html .= '<div class="field">' . ' <label>' . $field['label'] . ':</label>' . ' <span class="field-container">' . ' <input type="text" size="60" name="' . $field['name'] . '" value="' . Request::Get($field['name']) . '" />' . ' </span>' . '</div>';
break;
case self::TEXTAREA:
$html .= '<div class="field">' . ' <label>' . $field['label'] . ':</label>' . ' <span class="field-container">' . ' <textarea name="' . $field['name'] . '" rows="5" cols="80">' . Request::Get($field['name']) . '</textarea>' . ' </span>' . '</div>';
break;
case self::SELECT:
$html .= '<div class="field">' . ' <label>' . $field['label'] . ':</label>' . ' <span class="field-container">' . ' <select name="' . $field['name'] . '">' . self::OptionsSimple($field['options'], Request::Get($field['name'])) . ' </select>' . ' </span>' . '</div>';
break;
case self::CHECKBOX:
$html .= '<div class="field">' . ' <label></label>' . ' <span class="field-container">' . ' <div class="checkbox">' . ' <input type="hidden" name="' . $field['name'] . '" value="' . Request::Get($field['name']) . '" />' . ' ' . $field['label'] . ' </div>' . ' </span>' . '</div>';
break;
}
}
$DB->Free($result);
if (empty($html)) {
$html = '<div class="message-warning text-center">No Custom Fields Have Been Defined</div>';
}
return $html;
}
示例4: start
public function start()
{
$this->region_id = intval(Request::Cookie('region_id', 0));
$this->group_id = intval(Request::GetPart(1, 0));
$this->groups_array = GroupModel::GetList();
$this->groups_array[0] = 'Все направления';
$this->regions_array = RegionModel::GetList();
$this->regions_array[0] = 'Вся Россия';
if (!isset($this->groups_array[$this->group_id])) {
$this->group_id = 0;
}
if (!isset($this->regions_array[$this->region_id])) {
$this->region_id = 0;
}
$this->page_link_prefix = $this->group_id . '/';
$this->page = intval(Request::GetPart(2, 1));
if ($this->page == 0) {
$this->page = 1;
}
$this->search = trim(Request::Get('q', ''));
if ($this->search != '') {
$this->SearchCommand();
}
Site::$search_link = Site::Link('list/' . $this->group_id . '/');
}
示例5: __construct
public function __construct($source)
{
$this->source = $source;
// Do not put into thumbnail generation queue if video file is not being hotlinked
if (!Request::Get('flag_hotlink')) {
$_REQUEST['flag_thumb'] = 0;
}
}
示例6: __construct
public function __construct($xtable)
{
$this->xtable = $xtable;
$this->calculated_amount = null;
parse_str(Request::Get('search'), $this->search_form);
if (!isset($this->search_form['selected'])) {
$this->type = self::$TYPE_MATCHING;
} else {
$this->type = self::$TYPE_SELECTED;
}
}
示例7: DatabaseTest
function DatabaseTest()
{
global $DB;
try {
$DB = new Database_MySQL(Request::Get('db_username'), Request::Get('db_password'), Request::Get('db_database'), Request::Get('db_hostname'));
$version = $DB->Version();
if (!($version['major'] > 4 || $version['major'] == 4 && $version['minor'] > 0)) {
throw new BaseException('This software requires MySQL Server version 4.1.0 or newer', 'Your MySQL Server is version ' . $version['full']);
}
} catch (Exception $e) {
include_once 'install-main.php';
return false;
}
return true;
}
示例8: getLocationsAction
public function getLocationsAction()
{
$consumer_key = "FsywtAd1oz2eXBmyB287aQ";
$consumer_secret = "5TcavjzraS012EzEvVNwbqRTZkU";
$token = "S2zHmcgmot067mpaELvpFl99eycuTjn-";
$token_secret = "ZB1IkWAwa3X7_yq1i0U9dBjJkX8";
$unsigned_url = "http://api.yelp.com/v2/search?1=1";
$token = new OAuthToken($token, $token_secret);
$consumer = new OAuthConsumer($consumer_key, $consumer_secret);
$request = new Request();
$term = $request->Get("term");
$radius = $request->Get("radius");
$ll = $request->Get("ll");
$unsigned_url .= "&ll=" . ($ll == "" ? "39,-84" : $ll);
$unsigned_url .= "&radius_filter=" . ($radius == "" ? 1000 : $radius * 1000);
$unsigned_url .= $term == "" ? "" : "&term=" . $term;
// Yelp uses HMAC SHA1 encoding
$signature_method = new OAuthSignatureMethod_HMAC_SHA1();
// Build OAuth Request using the OAuth PHP library. Uses the consumer and token object created above.
$oauthrequest = OAuthRequest::from_consumer_and_token($consumer, $token, 'GET', $unsigned_url);
// Sign the request
$oauthrequest->sign_request($signature_method, $consumer, $token);
// Get the signed URL
$signed_url = $oauthrequest->to_url();
$ch = curl_init($signed_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, 0);
$data = curl_exec($ch);
// Yelp response
curl_close($ch);
// Handle Yelp response data
//$response = json_decode($data);
$response = $data;
// Print it for debugging
return $response;
}
示例9: RegisterFromXml
public function RegisterFromXml($xtable, $section = 'admin', $location = 'create')
{
$reflect = new ReflectionClass('Validator_Type');
foreach ($xtable->xpath('./columns/column') as $xcolumn) {
$xsection = $xcolumn->el('./' . $section);
if ($section != 'admin' && !empty($xsection) && !$xsection->el('./' . $location)->val()) {
continue;
}
$xvalidators = $xcolumn->xpath('./' . $section . '/validator');
if (empty($xvalidators)) {
continue;
}
foreach ($xvalidators as $xvalidator) {
$type = $reflect->getConstant($xvalidator->type->val());
$value = Request::Get($xcolumn->name->val());
switch ($xvalidator->condition->val()) {
case self::COND_NOT_EMPTY:
if (String::IsEmpty($value)) {
break;
}
default:
$this->Register($value, $type, $xvalidator->message->val(), $xvalidator->extras->val());
break;
}
}
}
}
示例10: isset
<div class="field">
<label>Frequency:</label>
<span class="field-container"><input type="text" size="5" name="frequency" value="<?php
echo Request::Get('frequency');
?>
" /></span>
</div>
</div>
</div>
<div id="dialog-buttons">
<img src="images/activity-16x16.gif" height="16" width="16" border="0" title="Working..." />
<input type="submit" id="button-save" value="<?php
echo isset($editing) ? 'Save Changes' : 'Add Search Term';
?>
" />
<input type="button" id="dialog-button-cancel" value="Cancel" style="margin-left: 10px;" />
</div>
<input type="hidden" name="r" value="<?php
echo isset($editing) ? 'tbxGenericEdit' : 'tbxGenericAdd';
?>
(search-term)" />
<input type="hidden" name="term_id" value="<?php
echo Request::Get('term_id');
?>
" />
</form>
示例11: Import
public static function Import($settings)
{
$DB = GetDB();
ProgressBarShow('pb-import');
$file = TEMP_DIR . '/' . File::Sanitize($settings['import_file']);
$fp = fopen($file, 'r');
$filesize = filesize($file);
$line = $read = $imported = 0;
$expected = count($settings['fields']);
while (!feof($fp)) {
$line++;
$string = fgets($fp);
$read += strlen($string);
$data = explode($settings['delimiter'], trim($string));
ProgressBarUpdate('pb-import', $read / $filesize * 100);
// Line does not have the expected number of fields
if (count($data) != $expected) {
continue;
}
$video = array();
$defaults = array('category_id' => $settings['category_id'], 'sponsor_id' => $settings['sponsor_id'], 'username' => $settings['username'], 'duration' => Format::DurationToSeconds($settings['duration']), 'status' => $settings['status'], 'next_status' => $settings['status'], 'allow_comments' => $settings['allow_comments'], 'allow_ratings' => $settings['allow_ratings'], 'allow_embedding' => $settings['allow_embedding'], 'is_private' => $settings['is_private'], 'date_added' => Database_MySQL::Now(), 'is_featured' => 0, 'is_user_submitted' => 0, 'conversion_failed' => 0, 'tags' => null, 'title' => null, 'description' => null);
foreach ($settings['fields'] as $index => $field) {
if (!empty($field)) {
$video[$field] = trim($data[$index]);
}
}
// Setup clips
$clips = array();
$thumbs = array();
$clip_type = 'URL';
if (isset($video['embed_code'])) {
// Cannot convert or thumbnail from embed code
$settings['flag_convert'] = $settings['flag_thumb'] = false;
$clips[] = $video['embed_code'];
$clip_type = 'Embed';
} else {
if (isset($video['gallery_url'])) {
$http = new HTTP();
if (!$http->Get($video['gallery_url'])) {
// Broken gallery URL, continue
continue;
}
list($thumbs, $clips) = Video_Source_Gallery::ExtractUrls($http->url, $http->body);
} else {
if (!isset($video['video_url']) && isset($video['base_video_url'])) {
if (!preg_match('~/$~', $video['base_video_url'])) {
$video['base_video_url'] .= '/';
}
foreach (explode(',', $video['video_filename']) as $filename) {
$clips[] = $video['base_video_url'] . $filename;
}
} else {
$clips[] = $video['video_url'];
}
}
}
// Check for duplicate clips
$duplicate = false;
foreach ($clips as $clip) {
if (!Request::Get('flag_skip_imported_check') && $DB->QueryCount('SELECT COUNT(*) FROM `tbx_imported` WHERE `video_url`=?', array($clip)) > 0) {
$duplicate = true;
}
$DB->Update('REPLACE INTO `tbx_imported` VALUES (?)', array($clip));
}
// Dupe found
if ($duplicate) {
continue;
}
// Setup thumbs
if (!isset($video['gallery_url']) && !isset($video['thumbnail_url']) && isset($video['base_thumbnail_url'])) {
if (!preg_match('~/$~', $video['base_thumbnail_url'])) {
$video['base_thumbnail_url'] .= '/';
}
foreach (explode(',', String::FormatCommaSeparated($video['thumbnail_filename'])) as $filename) {
$thumbs[] = $video['base_thumbnail_url'] . $filename;
}
} else {
if (!isset($video['gallery_url']) && isset($video['thumbnail_url'])) {
$thumbs[] = $video['thumbnail_url'];
}
}
// Setup duration
if (isset($video['duration_seconds'])) {
$video['duration'] = $video['duration_seconds'];
} else {
if (isset($video['duration_formatted'])) {
$video['duration'] = Format::DurationToSeconds($video['duration_formatted']);
}
}
// Use description for title
if (empty($video['title'])) {
$video['title'] = isset($video['description']) ? $video['description'] : '';
}
// Use title for description
if (empty($video['description'])) {
$video['description'] = isset($video['title']) ? $video['title'] : '';
}
// Use title for tags
if (empty($video['tags'])) {
$video['tags'] = isset($video['title']) ? $video['title'] : '';
//.........这里部分代码省略.........
示例12: before
<div class="checkbox">
<input type="hidden" name="is_private" value="<?php
echo Request::Get('is_private');
?>
" />
Make private
</div>
</span>
</div>
<div class="field">
<label></label>
<span class="field-container">
<div class="checkbox">
<input type="hidden" name="flag_skip_imported_check" value="<?php
echo Request::Get('flag_skip_imported_check');
?>
" />
Do not check if these videos have been imported before (may result in duplicates!)
</div>
</span>
</div>
</div>
<?php
if ($si->can_convert || $si->can_thumbnail) {
?>
<div class="fieldset">
<div class="legend">Import Settings</div>
示例13: isset
</div>
</div>
<div id="dialog-buttons">
<img src="images/activity-16x16.gif" height="16" width="16" border="0" title="Working..." />
<?php
if (!empty($categories)) {
?>
<input type="submit" id="button-save" value="<?php
echo isset($editing) ? 'Save Changes' : 'Add Video';
?>
" />
<?php
}
?>
<input type="button" id="dialog-button-cancel" value="Cancel" style="margin-left: 10px;" />
</div>
<input type="hidden" name="r" value="<?php
echo isset($editing) ? 'tbxVideoEdit' : 'tbxVideoAdd';
?>
(video)" />
<input type="hidden" name="video_id" value="<?php
echo Request::Get('video_id');
?>
" />
<input type="hidden" name="detailed" value="0" />
</form>
<?php
IncludeJavascript(BASE_DIR . '/admin/js/cp-video-add.js');
示例14: GetCurrency
/**
* Returns a form parameter minus currency symbols
*
* @param string $fieldname
* @return string
*/
public static function GetCurrency($fieldname)
{
return str_replace(array(',', '$'), '', Request::Get($fieldname));
}
示例15: define
define('DS', DIRECTORY_SEPARATOR);
define('ADMIN_DIR', dirname(__FILE__) . DS . '..' . DS);
define('BASE_DIR', dirname(__FILE__) . DS . '..' . DS . '..' . DS);
define('ADMIN_ROOT', '../');
define('SITE_ROOT', '../../');
require_once BASE_DIR . 'Libs' . DS . 'autoload.php';
require_once BASE_DIR . 'configs' . DS . 'incs.php';
require_once BASE_DIR . 'helpers' . DS . 'incs.php';
require_once ADMIN_DIR . 'incs' . DS . 'incs.php';
//-------------------------------------------------------
Util::$template_path = ADMIN_DIR . 'templates' . DS;
//-------------------------------------------------------
$db = new Db($db_config);
$sql = "SELECT * FROM `users` ORDER BY `id` DESC";
$done = Request::Get('done');
$smsg = "";
switch (strtolower($done)) {
case 'add':
$smsg = "User added successfully";
break;
case 'edit':
$smsg = "User edited successfully";
break;
case 'delete':
$smsg = "User deleted successfully";
break;
case 'edit_password':
$smsg = "User password edited successfully";
}
//-------------------------------------------------------