本文整理汇总了PHP中get_http_var函数的典型用法代码示例。如果您正苦于以下问题:PHP get_http_var函数的具体用法?PHP get_http_var怎么用?PHP get_http_var使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_http_var函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: api_getWrans_search
function api_getWrans_search($s) {
_api_getHansard_search( array(
's' => $s,
'pid' => get_http_var('person'),
'type' => 'wrans',
) );
}
开发者ID:nallachaitu,项目名称:theyworkforyou,代码行数:7,代码来源:api_getWrans.php
示例2: delete_success
function delete_success()
{
global $PAGE, $this_page;
$this_page = 'alertdeletesucceeded';
$PAGE->page_start();
$PAGE->stripe_start();
?>
<p>Your alert has been unsubscribed.</p>
<p>You will no longer receive this alert though any others you have requested will be unaffected. If you wish to unsubscribe from any more
alerts you will have to do this individually. If you wish to set new alerts then please visit OpenAustralia again.</p>
<p><strong>If you didn't mean to do this, <a href="<?php
echo WEBPATH;
?>
alert/undelete/?t=<?php
echo get_http_var('t');
?>
">resubscribe to this alert</a></strong></p>
<?php
$PAGE->stripe_end();
$PAGE->page_end();
}
开发者ID:leowmjw,项目名称:twfy,代码行数:26,代码来源:index.php
示例3: display
public function display()
{
$data = array();
$data['recent_election'] = false;
if ($this->user->loggedin()) {
$data['user_signed_in'] = true;
}
if (get_http_var('add-alert')) {
$data['email'] = get_http_var('email');
$data['postcode'] = get_http_var('postcode');
$result = $this->createAlertForPostCode($data['email'], $data['postcode']);
$data = array_merge($data, $result);
} elseif (get_http_var('update')) {
$result = $this->getNewMP(get_http_var('update'));
$data = array_merge($data, $result);
} elseif (get_http_var('update-alert')) {
$success = $this->replaceAlert(get_http_var('confirmation'));
$data['confirmation_received'] = $success;
} elseif (get_http_var('confirmed')) {
$success = $this->confirmAlert(get_http_var('confirmed'));
$data['confirmation_received'] = $success;
} else {
$data['email'] = $this->user->email() ? $this->user->email() : '';
$data['postcode'] = $this->user->postcode_is_set() ? $this->user->postcode() : '';
if ($this->isEmailSignedUpForPostCode($data['email'], $data['postcode'])) {
$data['already_signed_up'] = True;
$mp = $this->getPersonFromPostcode($data['postcode']);
$data['mp_name'] = $mp->full_name();
}
}
return $data;
}
开发者ID:vijo,项目名称:theyworkforyou,代码行数:32,代码来源:Simple.php
示例4: __construct
function __construct($pagepath = null)
{
$this->P = person_if_signed_on();
// "pwb_" prefix means passwordbox
$this->action = get_http_var('pwb_action');
$this->pw1 = get_http_var('pw1', null);
$this->pw2 = get_http_var('pw2', null);
$this->err = null;
$this->info = null;
if (is_null($pagepath)) {
// no specific page - use the _current_ one.
$foo = crack_url($_SERVER['REQUEST_URI']);
$this->pagepath = $foo['path'];
} else {
// use the one supplied.
$this->pagepath = $pagepath;
}
if (is_null($this->P)) {
return;
}
if ($this->action == 'set_password') {
if (is_null($this->pw1) || is_null($this->pw2)) {
$this->err = "Please type your new password twice";
} elseif (strlen($this->pw1) < 5 || strlen($this->pw2) < 5) {
$this->err = "Your password must be at least 5 characters long";
} elseif ($this->pw1 != $this->pw2) {
$this->err = "Please type the same password twice";
} else {
// all looks good. do it.
$this->P->password($this->pw1);
db_commit();
$this->info = 'Password changed';
}
}
}
开发者ID:bcampbell,项目名称:journalisted,代码行数:35,代码来源:passwordbox.php
示例5: dispatch
public static function dispatch()
{
$id = get_http_var('id');
$action = get_http_var('action');
$sql = <<<EOT
SELECT m.id,m.journo_id, j.ref, j.prettyname, j.oneliner, m.url, m.submitted, m.reason
FROM missing_articles m LEFT JOIN journo j ON m.journo_id=j.id
WHERE m.id=?;
EOT;
$row = db_getRow($sql, $id);
$w = new MissingArticleWidget($row);
// perform whatever action has been requested
$w->perform($action);
// is request ajax?
$ajax = get_http_var('ajax') ? true : false;
if ($ajax) {
$w->emit_core();
} else {
// not an ajax request, so output a full page
admPageHeader("Missing Article", "MissingArticleWidget::emit_head_js");
print "<h2>Missing article</h2>\n";
$w->emit_full();
admPageFooter();
}
}
开发者ID:bcampbell,项目名称:journalisted,代码行数:25,代码来源:missingarticle_widget.php
示例6: api_getMPsInfo_id
function api_getMPsInfo_id($ids)
{
$fields = preg_split('#\\s*,\\s*#', get_http_var('fields'), -1, PREG_SPLIT_NO_EMPTY);
$ids = preg_split('#\\s*,\\s*#', $ids, -1, PREG_SPLIT_NO_EMPTY);
$safe_ids = array(0);
foreach ($ids as $id) {
if (ctype_digit($id)) {
$safe_ids[] = $id;
}
}
$ids = join(',', $safe_ids);
$db = new ParlDB();
$last_mod = 0;
$q = $db->query("select person_id, data_key, data_value, lastupdate from personinfo\n\t\twhere person_id in (" . $ids . ")");
if ($q->rows()) {
$output = array();
for ($i = 0; $i < $q->rows(); $i++) {
$data_key = $q->field($i, 'data_key');
if (count($fields) && !in_array($data_key, $fields)) {
continue;
}
$pid = $q->field($i, 'person_id');
$output[$pid][$data_key] = $q->field($i, 'data_value');
$time = strtotime($q->field($i, 'lastupdate'));
if ($time > $last_mod) {
$last_mod = $time;
}
}
$q = $db->query("select memberinfo.*, person_id from memberinfo, member\n\t\t\twhere memberinfo.member_id=member.member_id and person_id in (" . $ids . ")\n\t\t\torder by person_id,member_id");
if ($q->rows()) {
$oldmid = 0;
$count = -1;
for ($i = 0; $i < $q->rows(); $i++) {
$data_key = $q->field($i, 'data_key');
if (count($fields) && !in_array($data_key, $fields)) {
continue;
}
$mid = $q->field($i, 'member_id');
$pid = $q->field($i, 'person_id');
if (!isset($output[$pid]['by_member_id'])) {
$output[$pid]['by_member_id'] = array();
}
if ($oldmid != $mid) {
$count++;
$oldmid = $mid;
$output[$pid]['by_member_id'][$count]['member_id'] = $mid;
}
$output[$pid]['by_member_id'][$count][$data_key] = $q->field($i, 'data_value');
$time = strtotime($q->field($i, 'lastupdate'));
if ($time > $last_mod) {
$last_mod = $time;
}
}
}
ksort($output);
api_output($output, $last_mod);
} else {
api_error('Unknown person ID');
}
}
开发者ID:leowmjw,项目名称:twfy,代码行数:60,代码来源:api_getMPsInfo.php
示例7: api_getAlerts_start_date
function api_getAlerts_start_date($start_date)
{
$args = array('start_date' => $start_date, 'end_date' => get_http_var('end_date'));
$alert = new ALERT();
$data = $alert->fetch_between($confirmed = 1, $deleted = 0, $args['start_date'], $args['end_date']);
api_output($data);
}
开发者ID:udp12,项目名称:theyworkforyou,代码行数:7,代码来源:api_getAlerts.php
示例8: view
function view()
{
$url = get_http_var('url', '');
$action = get_http_var('action');
$art = null;
$return_code = null;
$raw_output = '';
$summary = 'FAILED';
$urls_form = new ArticleURLsForm($_GET);
if ($urls_form->is_valid()) {
$url = $urls_form->cleaned_data['url'];
// already got it?
$art_id = article_find($url);
if (is_null($art_id)) {
list($return_code, $raw_output) = scrape_ScrapeURL($url);
$scraped = scrape_ParseOutput($raw_output);
if (sizeof($scraped) > 0) {
$art_id = $scraped[0]['id'];
$summary = 'ARTICLE SCRAPED';
} else {
$summary = 'NOT SCRAPED';
}
} else {
$summary = 'ALREADY IN DATABASE';
}
if (!is_null($art_id)) {
$art = fetch_art($art_id);
}
}
$v = array('urls_form' => $urls_form, 'return_code' => $return_code, 'raw_output' => $raw_output, 'summary' => $summary, 'art' => $art);
template($v);
}
开发者ID:bcampbell,项目名称:journalisted,代码行数:32,代码来源:scrape.php
示例9: get_params
function get_params()
{
$p['prettyname'] = trim(get_http_var('prettyname'));
$p['ref'] = trim(strtolower(get_http_var('ref')));
$p['firstname'] = trim(strtolower(get_http_var('firstname')));
$p['lastname'] = trim(strtolower(get_http_var('lastname')));
if ($p['prettyname']) {
$def_ref = strtolower($p['prettyname']);
$def_ref = preg_replace('/[^a-z]+/', '-', $def_ref);
$parts = explode(' ', strtolower($p['prettyname']));
if ($parts) {
$def_lastname = array_pop($parts);
$def_firstname = array_shift($parts);
}
if (!$p['ref']) {
$p['ref'] = $def_ref;
}
if (!$p['lastname']) {
$p['lastname'] = $def_lastname;
}
if (!$p['firstname']) {
$p['firstname'] = $def_firstname;
}
}
return $p;
}
开发者ID:bcampbell,项目名称:journalisted,代码行数:26,代码来源:journo-create.php
示例10: update_url
function update_url()
{
global $db;
global $scriptpath;
$out = '';
$sysretval = 0;
$personid = get_http_var('editperson');
$q = $db->query("DELETE FROM personinfo WHERE data_key = 'mp_website' AND personinfo.person_id = :person_id", array(':person_id' => $personid));
if ($q->success()) {
$q = $db->query("INSERT INTO personinfo (data_key, person_id, data_value) VALUES ('mp_website', :person_id, :url)", array(':person_id' => $personid, ':url' => get_http_var('url')));
}
if ($q->success()) {
exec($scriptpath . "/db2xml.pl --update_person --personid=" . escapeshellarg($personid) . " --debug", $exec_output);
$out = '<p id="warning">';
foreach ($exec_output as $message) {
$out .= $message . "<br>";
}
$out .= '</p>';
# ../../../scripts/db2xml.pl --update_person --personid=10001
}
if ($sysretval) {
$out .= '<p id="warning">Update Successful</p>';
}
return $out;
}
开发者ID:udp12,项目名称:theyworkforyou,代码行数:25,代码来源:websites.php
示例11: _api_getHansard_search
function _api_getHansard_search($array)
{
$search = isset($array['s']) ? trim($array['s']) : '';
$pid = trim($array['pid']);
$type = isset($array['type']) ? $array['type'] : '';
$search = filter_user_input($search, 'strict');
if ($pid) {
$search .= ($search ? ' ' : '') . 'speaker:' . $pid;
}
if ($type) {
$search .= " section:" . $type;
}
$o = get_http_var('order');
if ($o == 'p') {
$data = search_by_usage($search);
$out = array();
foreach ($data['speakers'] as $pid => $s) {
$out[$pid] = array('house' => $s['house'], 'name' => $s['name'], 'party' => $s['party'], 'count' => $s['count'], 'mindate' => substr($s['pmindate'], 0, 7), 'maxdate' => substr($s['pmaxdate'], 0, 7));
}
api_output($out);
return;
}
global $SEARCHENGINE;
$SEARCHENGINE = new SEARCHENGINE($search);
# $query_desc_short = $SEARCHENGINE->query_description_short();
$pagenum = get_http_var('page');
$args = array('s' => $search, 'p' => $pagenum, 'num' => get_http_var('num'), 'pop' => 1, 'o' => $o == 'd' || $o == 'r' ? $o : 'd');
$LIST = new HANSARDLIST();
$LIST->display('search', $args, 'api');
}
开发者ID:leowmjw,项目名称:twfy,代码行数:30,代码来源:api_getHansard.php
示例12: signup_form
function signup_form()
{
?>
<form class="free_our_bills_signup" method="post" action="subscribe">
<input type="hidden" name="posted" value="1">
<p><strong>This campaign can only succeed if normal internet users like you lend a hand.</strong>
Please sign up and we'll send you easy tasks (like emailing your MP, or coming up with some ideas). Together we can improve Parliament!
</p>
<p><label for="email">Your email:</label>
<input type="text" name="email" id="email" value="<?php
echo get_http_var('email');
?>
" size="30">
<br><label for="postcode">Your postcode:</label>
<input type="text" name="postcode" id="postcode" value="<?php
echo get_http_var('postcode');
?>
" size="10">
<input type="submit" class="submit" value="Join up">
</p>
</form>
<?php
}
开发者ID:palfrey,项目名称:twfy,代码行数:25,代码来源:share.php
示例13: fyr_display_emailform
function fyr_display_emailform()
{
$messages = array();
if (isset($_POST['action']) && $_POST['action'] == 'testmess') {
$messages = emailform_test_message();
if ($messages) {
emailform_display($messages);
return;
} else {
$dest = get_http_var('dest');
$contact_message = get_http_var('notjunk');
if ($dest == 'rep') {
$problem = 'You cannot contact your representative by filling in the WriteToThem contact form. To contact your representative, please visit <a href="/">www.writetothem.com</a> and enter your postcode. We have printed your message below so you can copy and paste it into the WriteToThem message box.';
wrongcontact_display($problem, $contact_message);
} elseif ($dest == 'other') {
$problem = 'You can only contact the team behind WriteToThem using our contact form. Your message is printed below so you can copy and paste it to wherever you want to send it.';
wrongcontact_display($problem, $contact_message);
} else {
if (emailform_send_message()) {
$messages['messagesent'] = 'Thanks, your message has been sent to ' . OPTION_WEB_DOMAIN;
} else {
$messages['messagenotsent'] = 'Sorry, there was a problem';
}
emailform_display($messages);
}
}
} else {
emailform_display($messages);
}
}
开发者ID:nallachaitu,项目名称:writetothem,代码行数:30,代码来源:emailform.php
示例14: getSearchSections
protected function getSearchSections()
{
$sections = array(array('section' => 'wrans', 'title' => 'Written Answers'));
if (get_http_var('type') == '') {
$sections[] = array('section' => 'wms', 'title' => 'Written Ministerial Statements');
}
return $sections;
}
开发者ID:vijo,项目名称:theyworkforyou,代码行数:8,代码来源:WransView.php
示例15: display_front
protected function display_front()
{
if (get_http_var('more')) {
return parent::display_front();
} else {
return $this->display_front_ni();
}
}
开发者ID:vijo,项目名称:theyworkforyou,代码行数:8,代码来源:NiView.php
示例16: setup
function setup()
{
$leaflet_id = get_http_var('q');
if (!isset($leaflet_id)) {
throw_404();
} else {
$this->leaflet_id = $leaflet_id;
}
}
开发者ID:schlos,项目名称:electionleaflets,代码行数:9,代码来源:full.php
示例17: admin_page_display
function admin_page_display($site_name, $pages, $default = null)
{
$maintitle = "{$site_name} admin";
if (get_http_var("page")) {
// find page
$id = get_http_var("page");
foreach ($pages as $page) {
if (isset($page) && $page->id == $id) {
break;
}
}
// display
ob_start();
if (isset($page->contenttype)) {
header($page->contenttype);
} else {
header("Content-Type: text/html; charset=utf-8");
$title = $page->navname . " - {$maintitle}";
admin_html_header($title);
print "<h1>{$title}</h1>";
}
$self_link = "?page={$id}";
$page->self_link = $self_link;
$page->display($self_link);
# TODO remove this as parameter, use class member
if (!isset($page->contenttype)) {
admin_html_footer();
}
} else {
header("Content-Type: text/html; charset=utf-8");
admin_html_header($maintitle);
print '<h3>' . $site_name . '</h3>';
if (!is_null($default)) {
$default->display();
}
// generate navigation bar
$navlinks = "<ul>";
foreach ($pages as $page) {
if (isset($page)) {
if (isset($page->url)) {
$navlinks .= "<li><a href=\"" . $page->url . "\">" . $page->navname . "</a>";
} else {
$navlinks .= "<li><a href=\"?page=" . $page->id . "\">" . $page->navname . "</a>";
}
} else {
$navlinks .= '</ul> <ul>';
}
}
$navlinks .= '</ul>';
print $navlinks;
?>
<p><a href="http://www.mysociety.org/"><img class="mslogo" src="https://secure.mysociety.org/mysociety_sm.gif" border="0" alt="mySociety"></a></p>
<?php
admin_html_footer();
}
}
开发者ID:palfrey,项目名称:phplib,代码行数:56,代码来源:admin.php
示例18: display
public function display()
{
global $PAGE;
if ($spid = get_http_var('spid')) {
$this->spwrans_redirect($spid);
$PAGE->page_end();
} else {
return parent::display();
}
}
开发者ID:udp12,项目名称:theyworkforyou,代码行数:10,代码来源:SpwransView.php
示例19: setup
function setup()
{
$leaflet_id = get_http_var('q');
if (!isset($leaflet_id)) {
throw_404();
} else {
$this->viewstate['leaflet_id'] = $leaflet_id;
}
$this->viewstate['message_sent'] = false;
}
开发者ID:schlos,项目名称:electionleaflets,代码行数:10,代码来源:report.php
示例20: formFetch
function formFetch()
{
$p = array();
$p['action'] = get_http_var('action');
$p['name'] = get_http_var('name');
$p['email'] = get_http_var('email');
$p['message'] = get_http_var('message');
$p['recaptcha_response_field'] = get_http_var('recaptcha_response_field', null);
$p['recaptcha_challenge_field'] = get_http_var('recaptcha_challenge_field');
return $p;
}
开发者ID:bcampbell,项目名称:journalisted,代码行数:11,代码来源:forward.php
注:本文中的get_http_var函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论