本文整理匯總了PHP中session::get_param方法的典型用法代碼示例。如果您正苦於以下問題:PHP session::get_param方法的具體用法?PHP session::get_param怎麽用?PHP session::get_param使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類session
的用法示例。
在下文中一共展示了session::get_param方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Main
<?php
include '../core/main.class.php';
$main = new Main();
//check for loged in
$id = Security::secureString($_GET['id']);
$idea = mysql_fetch_array($main->con()->db_query("SELECT votes FROM feedback_ideas WHERE id='{$id}'"));
if (session::check()) {
$voter_id = session::get_param('user_id');
$main->con()->db_query("UPDATE feedback_ideas SET votes=votes+1 WHERE id='{$id}'");
$main->con()->db_query("INSERT INTO feedback_votes (idea_id,voter_id) VALUES('{$id}','{$voter_id}')");
}
echo render::dynamicFont(number_format($idea['votes'] + 1, 0, '', ','), 32);
?>
<br/>
votes<br/>
示例2: Main
<?php
include '../core/main.class.php';
$main = new Main();
//check for loged in
$id = Security::secureString($_GET['id']);
$status = Security::secureString($_GET['status']);
if (session::check() && session::get_param('admin')) {
$main->con()->db_query("UPDATE feedback_ideas SET status='{$status}' WHERE id='{$id}'");
$info = array('status' => '<div id="status_' . $id . '" class="nr_votes ' . render::giveStatus($status, "class") . '">' . render::giveStatus($status, "text") . '</div>', 'adm_com' => '<div id="com_status_' . $id . '" class="ad_' . render::giveStatus($status, "class") . '"></div>');
echo json_encode($info);
}
示例3:
?>
<br/>
<?php
if (session::check()) {
?>
<!--Post comment-->
<div class="comentit">
<div class="sayit">Say something:</div>
<form action="javascript:void(0)" id="post_comment">
<input type="hidden" id="idea_id" name="idea_id" value="<?php
echo $id;
?>
"/>
<label for="comment">Comment...</label>
<textarea id="comment" name="comment" rows="5" cols="5"></textarea>
<input type="submit" class="medium button red" value="Say it"/>
<?php
if (session::get_param('admin')) {
?>
<label><input type="checkbox" value="1" id="admin_change" name="admin_change"/> Change the administrator comment.</label>
<?php
}
?>
</form>
</div>
<?php
}
?>
</div>
<br clear="all"/>
示例4: Main
<?php
include '../../../core/main.class.php';
$main = new Main();
//check for loged in
$title = Security::secureString($_GET['title']);
$descr = Security::secureString($_GET['description']);
$auth_id = session::get_param('user_id');
$main->con()->db_query("INSERT INTO feedback_ideas (idea,description,sub_date,auth_id) VALUES('{$title}','{$descr}',NOW(),'{$auth_id}')");
//insert si in votes votu lu asta!
$id = mysql_insert_id();
$idea = mysql_fetch_array($main->con()->db_query("SELECT idea,id FROM feedback_ideas WHERE id='{$id}'"));
$url = HTTP_CORE_BASE . 'idea/id/' . $idea['id'] . '/' . render::makeTitle($idea['idea']);
echo '&url=' . $url;
示例5: while
while ($i_videas = mysql_fetch_assoc($videas_q)) {
$voted_ideas[] = $i_videas;
}
}
//SEARCH TIME
$sql = "SELECT * FROM feedback_ideas WHERE " . $selu . "" . $order;
$p = new Paginator($sql, IDEAS_PER_PAGE, $pars, $pagename);
$total_pages = $p->getTotalPages();
if ($page > 0) {
$prev_page = $page - 1;
}
if ($total_pages > $page) {
$next_page = $page + 1;
}
$result_resources = $p->getPageNumber($page);
while ($info = mysql_fetch_array($result_resources)) {
$ideas[] = $info;
}
$qmy_ideas = $main->con()->db_query("SELECT id,idea,votes FROM feedback_ideas WHERE auth_id='" . session::get_param('user_id') . "' ORDER BY sub_date DESC LIMIT 4");
$my_ideas = array();
while ($idea = mysql_fetch_array($qmy_ideas)) {
$my_ideas[] = $idea;
}
$qmy_votes = $main->con()->db_query("SELECT * FROM feedback_votes WHERE voter_id='" . session::get_param('user_id') . "' ORDER BY id DESC LIMIT 4");
$my_votes = array();
while ($vote = mysql_fetch_array($qmy_votes)) {
$idea = mysql_fetch_array($main->con()->db_query("SELECT id,idea,votes FROM feedback_ideas WHERE id='" . $vote['idea_id'] . "'"));
$my_votes[] = $idea;
}
$user = mysql_fetch_assoc($main->con()->db_query("SELECT username,id,email FROM members WHERE id='" . session::get_param('user_id') . "'"));
示例6: die
<?php
if (!defined('CORE_DIR')) {
die('No direct script access allowed');
}
$voted_ideas = array();
if (session::check()) {
$videas_q = $main->con()->db_query("SELECT idea_id FROM feedback_votes WHERE voter_id='" . session::get_param('user_id') . "'");
while ($i_videas = mysql_fetch_assoc($videas_q)) {
$voted_ideas[] = $i_videas;
}
}
$id = $pars['id'];
$idea = mysql_fetch_array($main->con()->db_query("SELECT * FROM feedback_ideas WHERE id='{$id}'"));
$title = $idea['idea'];
$idea_link = 'idea/id/' . $id . '/title/' . render::makeTitle($title);
if (!isset($pars['page'])) {
$page = 1;
} else {
$page = $pars['page'];
}
$order = ' ORDER BY date DESC';
$selu = "idea_id='{$id}'";
//SEARCH TIME
$sql = "SELECT * FROM feedback_comments WHERE " . $selu . "" . $order;
$p = new Paginator($sql, COMMENTS_PER_PAGE, $pars, $pagename);
$total_pages = $p->getTotalPages();
if ($page > 0) {
$prev_page = $page - 1;
}
if ($total_pages > $page) {