本文整理汇总了PHP中getparam函数的典型用法代码示例。如果您正苦于以下问题:PHP getparam函数的具体用法?PHP getparam怎么用?PHP getparam使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getparam函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionIndex
public function actionIndex()
{
if (isset($_COOKIE['mainbtc'])) {
return;
}
if (!LimitRequest('explorer')) {
return;
}
$id = getiparam('id');
$coin = getdbo('db_coins', $id);
$height = getparam('height');
if ($coin && intval($height) > 0) {
$remote = new Bitcoin($coin->rpcuser, $coin->rpcpasswd, $coin->rpchost, $coin->rpcport);
$hash = $remote->getblockhash(intval($height));
} else {
$hash = getparam('hash');
}
$txid = getparam('txid');
if ($coin && !empty($txid) && ctype_alnum($txid)) {
$remote = new Bitcoin($coin->rpcuser, $coin->rpcpasswd, $coin->rpchost, $coin->rpcport);
$tx = $remote->getrawtransaction($txid, 1);
$hash = $tx['blockhash'];
}
if ($coin && !empty($hash) && ctype_alnum($hash)) {
$this->render('block', array('coin' => $coin, 'hash' => substr($hash, 0, 64)));
} else {
if ($coin) {
$this->render('coin', array('coin' => $coin));
} else {
$this->render('index');
}
}
}
示例2: go
function go()
{
$a = getparam('a', true);
$f = substr($a, 0, 1);
if ($f != '1' and $f != '3') {
return;
}
if (preg_match('/^[a-zA-Z0-9]{24,}[\\._]?[a-zA-Z0-9\\._]*$/', $a) === false) {
return;
}
$sta = "../pool/workers/{$a}";
if (file_exists($sta)) {
echo file_get_contents($sta);
}
}
示例3: wrapResponse
function wrapResponse($response, $doc)
{
if (isset($response)) {
if (isset($response->error)) {
$data = '{"error":"' . $response->error . '"}';
} else {
$data = '{"success":true, "obj":' . json_encode($doc) . '}';
}
} else {
$data = json_encode($doc);
}
$cb = getparam('callback');
if ($cb) {
echo $cb . '(' . $data . ')';
} else {
echo $data;
}
}
示例4: douserset
function douserset($data, $user)
{
$err = '';
$chg = getparam('Change', false);
$api = false;
switch ($chg) {
case 'API Key':
$ans = getAtts($user, 'KAPIKey.str,KAPIKey.dateexp');
if ($ans['STATUS'] != 'ok') {
dbdown();
}
// Should be no other reason?
if (isset($ans['KAPIKey.dateexp']) && $ans['KAPIKey.dateexp'] == 'N') {
$err = 'You can only change it once a day';
if (isset($ans['KAPIKey.str'])) {
$api = $ans['KAPIKey.str'];
}
} else {
$ran = $ans['STAMP'] . $user . rand(100000000, 999999999);
$api = hash('md4', $ran);
$day = 60 * 60 * 24;
$ans = setAtts($user, array('ua_KAPIKey.str' => $api, 'ua_KAPIKey.date' => "now+{$day}"));
if ($ans['STATUS'] != 'ok') {
syserror();
}
}
break;
}
if ($api === false) {
$ans = getAtts($user, 'KAPIKey.str');
if ($ans['STATUS'] != 'ok') {
dbdown();
}
// Should be no other reason?
if (isset($ans['KAPIKey.str'])) {
$api = $ans['KAPIKey.str'];
}
}
$pg = uset($data, $user, $api, $err);
return $pg;
}
示例5: doworkmgt
function doworkmgt($data, $user)
{
$err = '';
$S = getparam('S', false);
$chk = getparam('seven', false);
if ($S == 'Update') {
$settings = array();
if ($chk == 'on') {
$settings['oldworkers'] = '7';
} else {
$settings['oldworkers'] = '0';
}
$ans = workerSet($user, $settings);
if ($ans['STATUS'] != 'ok') {
$err = $ans['ERROR'];
}
} else {
$OK = getparam('OK', false);
$count = getparam('rows', false);
if ($OK == 'OK' && !nuem($count)) {
if ($count > 0 && $count < 9999) {
$settings = array();
for ($i = 0; $i < $count; $i++) {
$wn = urldecode(getparam('workername:' . $i, false));
$md = getparam('difficultydefault:' . $i, false);
if (!nuem($wn) && !nuem($md)) {
$settings['workername:' . $i] = $wn;
$settings['difficultydefault:' . $i] = $md;
}
}
$ans = workerSet($user, $settings);
if ($ans['STATUS'] != 'ok') {
$err = $ans['ERROR'];
}
}
}
}
$pg = workmgtuser($data, $user, $err);
return $pg;
}
示例6: actionSellto
public function actionSellto()
{
if (!$this->admin) {
return;
}
$market = getdbo('db_markets', getiparam('id'));
$coin = getdbo('db_coins', $market->coinid);
$amount = getparam('amount');
$remote = new Bitcoin($coin->rpcuser, $coin->rpcpasswd, $coin->rpchost, $coin->rpcport);
$info = $remote->getinfo();
if (!$info || !$info['balance']) {
return false;
}
$deposit_info = $remote->validateaddress($market->deposit_address);
if (!$deposit_info || !isset($deposit_info['isvalid']) || !$deposit_info['isvalid']) {
user()->setFlash('error', "invalid address {$coin->name}, {$market->deposit_address}");
$this->redirect(array('site/coin', 'id' => $coin->id));
}
$amount = min($amount, $info['balance'] - $info['paytxfee']);
// $amount = max($amount, $info['balance'] - $info['paytxfee']);
$amount = round($amount, 8);
debuglog("selling ({$market->deposit_address}, {$amount})");
$tx = $remote->sendtoaddress($market->deposit_address, $amount);
if (!$tx) {
user()->setFlash('error', $remote->error);
$this->redirect(array('site/coin', 'id' => $coin->id));
}
$exchange = new db_exchange();
$exchange->market = $market->name;
$exchange->coinid = $coin->id;
$exchange->send_time = time();
$exchange->quantity = $amount;
$exchange->price_estimate = $coin->price;
$exchange->status = 'waiting';
$exchange->tx = $tx;
$exchange->save();
$this->redirect(array('site/coin', 'id' => $coin->id));
}
示例7: check
function check()
{
$dmenu = def_menu();
$menu = array('Home' => array('Home' => ''), 'Account' => array('Rewards' => 'mpayouts', 'Payments' => 'payments', 'Settings' => 'settings', 'User Settings' => 'userset', '2FA Settings' => '2fa'), 'Workers' => array('Shifts' => 'shifts', 'Shift Graph' => 'usperf', 'Workers' => 'workers', 'Management' => 'workmgt'), 'Pool' => array('Stats' => 'stats', 'Blocks' => 'blocks', 'Graph' => 'psperf', 'Acclaim' => 'userinfo', 'Luck' => 'luck'), 'Admin' => NULL, 'gap' => array('API' => 'api', 'PBlocks' => 'pblocks'), 'Help' => array('Payouts' => 'payout'));
tryLogInOut();
$who = loggedIn();
if ($who === false) {
$p = getparam('k', true);
if ($p == 'reset') {
showPage(NULL, 'reset', $dmenu, '', $who);
} else {
if (requestLoginRegReset() == true) {
showPage(NULL, 'reg', $dmenu, '', $who);
} else {
$p = getparam('k', true);
process($p, $who, $dmenu);
}
}
} else {
$p = getparam('k', true);
process($p, $who, $menu);
}
}
示例8: header
voice: 972.669.0041
fax: 972.669.8972
*/
header("Expires: " . GMDate("D, d M Y H:i:s") . " GMT");
require_once '../../bit_setup_inc.php';
$gBitSystem->verifyPermission('bit_p_bitcart_admin');
require_once BITCART_PKG_PATH . 'functions.php';
// ========== start of variable loading ==========
// load passed variables and cookie variables
// int or double cast the numbers, no exceptions
$zoneid = (int) getparam('zoneid');
$langid = (int) getparam('langid');
$show = (int) getparam('show');
$srch = (int) getparam('srch');
$act = getparam('act');
$oldzid = (int) getparam('oldzid');
// ========== end of variable loading ==========
require './admin.php';
require './header.php';
$droot = "BITCART_PKG_PATH";
if ($zoneid == 0) {
?>
Please click the "Back" button on your browser
and select a default zone. Thank you.
<?php
exit;
}
$fcm = new FC_SQL();
$fcm->Auto_commit = 0;
$fcm->query("select count(*) as cnt from master");
$fcm->next_record();
示例9: array
* not to allow others to use your version of this file under the terms of the
* EPL, indicate your decision by deleting the provisions above and replace them
* with the notice and other provisions required by the GPL.
*
* Contributors:
* Evgeny Gryaznov - initial API and implementation
*/
require_once '../libs/common.php';
require_once '../libs/operator.php';
require_once '../libs/settings.php';
require_once '../libs/notify.php';
$errors = array();
$page = array('version' => $version);
$loginoremail = "";
if (isset($_POST['loginoremail'])) {
$loginoremail = getparam("loginoremail");
$torestore = is_valid_email($loginoremail) ? operator_by_email($loginoremail) : operator_by_login($loginoremail);
if (!$torestore) {
$errors[] = getlocal("no_such_operator");
}
$email = $torestore['vcemail'];
if (count($errors) == 0 && !is_valid_email($email)) {
$errors[] = "Operator hasn't set his e-mail";
}
if (count($errors) == 0) {
$token = md5(time() + microtime() . rand(0, 99999999));
$link = connect();
$query = "update {$mysqlprefix}chatoperator set dtmrestore = CURRENT_TIMESTAMP, vcrestoretoken = '{$token}' where operatorid = " . $torestore['operatorid'];
perform_query($query, $link);
$href = get_app_location(true, false) . "/operator/resetpwd.php?id=" . $torestore['operatorid'] . "&token={$token}";
webim_mail($email, $email, getstring("restore.mailsubj"), getstring2("restore.mailtext", array(get_operator_name($torestore), $href)), $link);
示例10: getparam
// load passed variables and cookie variables
// int or double cast the numbers, no exceptions
// if $zid or $lid are found, they should be changed
// to $zoneid or $langid, respectively. Once all
// maint files are done, $zid and $lid can probably
// be eliminated.
$zoneid = (int) getparam('zoneid');
$langid = (int) getparam('langid');
$act = getparam('act');
$sku = getparam('sku');
$nsy = (int) getparam('nsy');
$nsm = (int) getparam('nsm');
$nsd = (int) getparam('nsd');
$ney = (int) getparam('ney');
$nem = (int) getparam('nem');
$ned = (int) getparam('ned');
// ========== end of variable loading ==========
if (strlen($sku) > 20) {
?>
The SKU description field exceeds 20 characters.
<p>Please click the "Back" button on your browser
and correct the errors. Thank you.
<?php
exit;
}
if ($act == "insert" || $act == "update") {
if ($nsm != "" && $nsd != "" && $nsy != "" && $nem != "" && $ned != "" && $ney != "") {
$sdate = mktime(0, 0, 0, $nsm, $nsd, $nsy);
$ndate = mktime(0, 0, 0, $nem, $ned, $ney);
} else {
$sdate = 0;
示例11: dopplns
function dopplns($data, $user)
{
global $send_sep;
$pg = '<h1>CKPool</h1>';
$blk = getparam('blk', true);
if (nuem($blk)) {
$tx = '';
# so can make a link
$blkuse = getparam('blkuse', true);
if (nuem($blkuse)) {
$blkuse = '';
} else {
$tx = 'y';
}
$pg = '<br>' . makeForm('pplns') . "\nBlock: <input type=text name=blk size=10 value='{$blkuse}'>\n Tx: <input type=text name=tx size=1 value='{$tx}'>\n Dust (Satoshi): <input type=text name=dust size=5 value='10000'>\n Fee (BTC): <input type=text name=fee size=5 value='0.0'>\n <input type=submit name=Calc value=Calc>\n</form>";
} else {
$tx = getparam('tx', true);
if (nuem($tx) || substr($tx, 0, 1) != 'y') {
$dotx = false;
} else {
$dotx = true;
}
$flds = array('height' => $blk, 'allow_aged' => 'Y');
if ($blk > 334106) {
$flds['diff_times'] = '5';
}
$msg = msgEncode('pplns', 'pplns', $flds, $user);
$rep = sendsockreply('pplns', $msg, 4);
if ($rep == false) {
$ans = array();
} else {
$ans = repDecode($rep);
}
if ($ans['ERROR'] != null) {
return '<font color=red size=+1><br>' . $ans['STATUS'] . ': ' . $ans['ERROR'] . '</font>';
}
if (!isset($ans['pplns_last'])) {
return '<font color=red size=+1><br>Partial data returned</font>';
}
$reward_sat = $ans['block_reward'];
$miner_sat = round($reward_sat * 0.991);
$ans['miner_sat'] = $miner_sat;
$data = array('Block' => 'block', 'Block Status' => 'block_status', 'Block Hash' => 'block_hash', 'Block Reward (Satoshis)' => 'block_reward', 'Miner Reward (Satoshis)' => 'miner_sat', 'PPLNS Wanted' => '.diff_want', 'PPLNS Used' => '.diffacc_total', 'Elapsed Seconds' => ',pplns_elapsed', 'Users' => 'rows', 'Oldest Workinfoid' => 'begin_workinfoid', 'Oldest Time' => 'begin_stamp', 'Oldest Epoch' => 'begin_epoch', 'Block Workinfoid' => 'block_workinfoid', 'Block Time' => 'block_stamp', 'Block Epoch' => 'block_epoch', 'Newest Workinfoid' => 'end_workinfoid', 'Newest Share Time' => 'end_stamp', 'Newest Share Epoch' => 'end_epoch', 'Network Difficulty' => 'block_ndiff', 'PPLNS Factor' => 'diff_times', 'PPLNS Added' => 'diff_add', 'Accepted Share Count' => ',acc_share_count', 'Total Share Count' => ',total_share_count', 'ShareSummary Count' => ',ss_count', 'WorkMarkers Count' => ',wm_count', 'MarkerSummary Count' => ',ms_count');
$pg = '<br><a href=https://blockchain.info/block-height/';
$pg .= $ans['block'] . '>Blockchain ' . $ans['block'] . "</a><br>\n";
if (strlen($ans['marks_status']) > 0) {
$pg .= '<br><span class=err>';
$msg = $ans['marks_status'];
$pg .= str_replace(' ', ' ', $msg) . "</span><br>\n";
}
if (strlen($ans['block_extra']) > 0) {
$pg .= '<br><span class=err>';
$msg = $ans['block_status'] . ' - ' . $ans['block_extra'];
$pg .= str_replace(' ', ' ', $msg) . "</span><br>\n";
}
if (strlen($ans['share_status']) > 0) {
$pg .= '<br><span class=err>';
$msg = $ans['share_status'] . " - Can't be paid out yet";
$pg .= str_replace(' ', ' ', $msg) . "</span><br>\n";
}
$pg .= "<br><table cellpadding=0 cellspacing=0 border=0>\n";
$pg .= '<tr class=title>';
$pg .= '<td class=dl>Name</td>';
$pg .= '<td class=dr>Value</td>';
$pg .= "</tr>\n";
$i = 0;
foreach ($data as $dsp => $name) {
if ($i++ % 2 == 0) {
$row = 'even';
} else {
$row = 'odd';
}
$pg .= "<tr class={$row}>";
$pg .= "<td class=dl>{$dsp}</td>";
switch ($name[0]) {
case ',':
case '.':
$nm = substr($name, 1);
$fmt = fmtdata($name[0], $ans[$nm]);
break;
default:
$fmt = $ans[$name];
break;
}
$pg .= "<td class=dr>{$fmt}</td>";
$pg .= "</tr>\n";
}
$pg .= "</table><br><table cellpadding=0 cellspacing=0 border=0>\n";
$pg .= '<tr class=title>';
$pg .= '<td class=dl>User</td>';
$pg .= '<td class=dr>Diff Accepted</td>';
$pg .= '<td class=dr>%</td>';
$pg .= '<td class=dr>Avg Hashrate</td>';
$pg .= '<td class=dr>BTC -0.9%</td>';
$pg .= '<td class=dr>Address</td>';
$pg .= "</tr>\n";
$diffacc_total = $ans['diffacc_total'];
if ($diffacc_total == 0) {
$diffacc_total = pow(10, 15);
}
//.........这里部分代码省略.........
示例12: FishNet
N. Michael Brennen
FishNet(R), Inc.
850 S. Greenville, Suite 102
Richardson, TX 75081
http://www.fni.com/
mbrennen@fni.com
voice: 972.669.0041
fax: 972.669.8972
*/
header("Last-Modified: " . gmdate("D, d M Y H:i:s", time()) . " GMT");
require_once BITCART_PKG_PATH . 'functions.php';
// ========== start of variable loading ==========
// load passed variables and cookie variables
// int or double cast the numbers, no exceptions
$zoneid = (int) getparam('zoneid');
$langid = (int) getparam('langid');
// ========== end of variable loading ==========
require './admin.php';
require './header.php';
$fcl = new FC_SQL();
$fcp = new FC_SQL();
if (!$zoneid || !$langid) {
?>
Please click Back and select a zone and/or language. Thank you.
<?php
exit;
}
?>
<h2 align=center>Keyword Search Statistics</h2>
<hr>
示例13: need_user
* Free Software Foundation, версии 3.
* В случае отсутствия файла «License» (идущего вместе с исходными кодами программного обеспечения)
* описывающего условия GNU General Public License версии 3, можно посетить официальный сайт
* http://www.gnu.org/licenses/ , где опубликованы условия GNU General Public License
* различных версий (в том числе и версии 3).
* | ENG | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* "Komunikator" is a web interface for IP-PBX "YATE" configuration and management
* Copyright (C) 2012-2013, "Telephonnyie sistemy" Ltd.
* THIS FILE is an integral part of the project "Komunikator"
* "Komunikator" project site: http://komunikator.ru/
* "Komunikator" technical support e-mail: support@komunikator.ru
* The project "Komunikator" are used:
* the source code of "YATE" project, http://yate.null.ro/pmwiki/
* the source code of "FREESENTRAL" project, http://www.freesentral.com/
* "Sencha Ext JS" project libraries, http://www.sencha.com/products/extjs
* "Komunikator" web application is a free/libre and open-source software. Therefore it grants user rights
* for distribution and (or) modification (including other rights) of this programming solution according
* to GNU General Public License terms and conditions published by Free Software Foundation in version 3.
* In case the file "License" that describes GNU General Public License terms and conditions,
* version 3, is missing (initially goes with software source code), you can visit the official site
* http://www.gnu.org/licenses/ and find terms specified in appropriate GNU General Public License
* version (version 3 as well).
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*/
need_user();
$status = getparam("status");
$action = 'destroy_prompts';
$rows = array();
$rows[] = array('id' => "(SELECT prompt_id FROM (SELECT * from prompts) a where a.status = '{$status}')");
$id_name = 'prompt_id';
require_once "destroy.php";
示例14: actionWithdraw
public function actionWithdraw()
{
$fees = 0.0001;
$deposit = user()->getState('yaamp-deposit');
if (!$deposit) {
$this->render('login');
return;
}
$renter = getrenterparam($deposit);
if (!$renter) {
$this->render('login');
return;
}
$amount = getparam('withdraw_amount');
$address = getparam('withdraw_address');
$amount = floatval(bitcoinvaluetoa(min($amount, $renter->balance - $fees)));
if ($amount < 0.001) {
user()->setFlash('error', 'Minimum withdraw is 0.001');
$this->redirect("/renting");
return;
}
$coin = getdbosql('db_coins', "symbol='BTC'");
if (!$coin) {
return;
}
$remote = new Bitcoin($coin->rpcuser, $coin->rpcpasswd, $coin->rpchost, $coin->rpcport);
$res = $remote->validateaddress($address);
if (!$res || !isset($res['isvalid']) || !$res['isvalid']) {
user()->setFlash('error', 'Invalid address');
$this->redirect("/renting");
return;
}
$rentertx = new db_rentertxs();
$rentertx->renterid = $renter->id;
$rentertx->time = time();
$rentertx->amount = $amount;
$rentertx->type = 'withdraw';
$rentertx->address = $address;
$rentertx->tx = 'scheduled';
$rentertx->save();
debuglog("withdraw scheduled {$renter->id} {$renter->address}, {$amount} to {$address}");
user()->setFlash('message', "withdraw scheduled");
$this->redirect("/renting");
}
示例15: array
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once 'libs/common.php';
require_once 'libs/chat.php';
require_once 'libs/expand.php';
require_once 'libs/notify.php';
$errors = array();
$page = array();
$token = verifyparam("token", "/^\\d{1,8}\$/");
$threadid = verifyparam("thread", "/^\\d{1,8}\$/");
$thread = thread_by_id($threadid);
if (!$thread || !isset($thread['ltoken']) || $token != $thread['ltoken']) {
die("wrong thread");
}
$email = getparam('email');
$page['email'] = $email;
if (!$email) {
$errors[] = no_field("form.field.email");
} else {
if (!is_valid_email($email)) {
$errors[] = wrong_field("form.field.email");
}
}
if (count($errors) > 0) {
$page['formemail'] = $email;
$page['ct.chatThreadId'] = $thread['threadid'];
$page['ct.token'] = $thread['ltoken'];
$page['level'] = "";
setup_logo();
expand("styles", getchatstyle(), "mail.tpl");