當前位置: 首頁>>代碼示例>>PHP>>正文


PHP InterestManager::addInterest方法代碼示例

本文整理匯總了PHP中InterestManager::addInterest方法的典型用法代碼示例。如果您正苦於以下問題:PHP InterestManager::addInterest方法的具體用法?PHP InterestManager::addInterest怎麽用?PHP InterestManager::addInterest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在InterestManager的用法示例。


在下文中一共展示了InterestManager::addInterest方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: header

require_once "InterestManager.class.php";
if (!isset($_SESSION['user_id'])) {
    header("Location: login.php");
    //Ära enne suunamist midagi rohkem tee
    exit;
}
if (isset($_GET["logout"])) {
    session_destroy();
    header("Location: login.php");
    exit;
}
##HALDUS##
$InterestManager = new InterestManager($mysqli, $_SESSION['user_id']);
if (isset($_GET["insert"])) {
    $int_name = $_GET["insert"];
    $InterestManager->addInterest($int_name);
    $interest_response = $InterestManager->addInterest($int_name);
}
if (isset($_GET["dropdown_interest"])) {
    $InterestManager->addUserInterests($_SESSION['user_id'], $_GET["dropdown_interest"]);
    $user_int_response = $InterestManager->addUserInterests($_SESSION['user_id'], $_GET["dropdown_interest"]);
    var_dump($user_int_response);
}
?>

Tere, <?php 
echo $_SESSION['user_email'];
?>
 <a href="?logout=1">Logi välja</a>

<br>
開發者ID:Raunts26,項目名稱:10.-tund,代碼行數:31,代碼來源:data.php

示例2: header

if (!isset($_SESSION["id_from_db"])) {
    header("Location: login_sample.php");
    //---------------------
    //----OLULINE----------
    //---------------------
    exit;
}
if (isset($_GET["logout"])) {
    session_destroy();
    header("Location: login_sample.php");
}
//teen uue instantsi class InterestManagerist
$InterestManager = new InterestManager($mysqli);
//aadressireal on new_interest
if (isset($_GET["new_interest"])) {
    $added_interest = $InterestManager->addInterest($_GET["new_interest"]);
}
if (isset($_GET["dropdownselect"])) {
    $added_user_interest = $InterestManager->addUserInterest($_GET["dropdownselect"], $_SESSION["id_from_db"]);
}
?>
 
 <p>
	Tere, <?php 
echo $_SESSION["user_email"];
?>
	<a href="?logout=1"> Logi välja </a>
</p>


<h2>Lisa uus huviala</h2>
開發者ID:kertkulp,項目名稱:10.tund,代碼行數:31,代碼來源:data.php

示例3: header

require_once "InterestManager.class.php";
if (!isset($_SESSION["user_id"])) {
    header("Location: login.php");
    exit;
}
if (isset($_GET["logout"])) {
    session_destroy();
    header("Location: login.php");
    exit;
}
//***************
//** HALDUS *****
//***************
$InterestManager = new InterestManager($mysqli, $_SESSION["user_id"]);
if (isset($_GET["new_interest"])) {
    $add_interest_response = $InterestManager->addInterest($_GET["new_interest"]);
}
?>

  <?php 
if (isset($add_interest_response->success)) {
    ?>
  
  <p style="color:green;">
    <?php 
    echo $add_interest_response->success->message;
    ?>
  </p>
  
  <?php 
} elseif (isset($add_interest_response->error)) {
開發者ID:raikolepik,項目名稱:10.tund,代碼行數:31,代碼來源:data.php

示例4: header

require_once "functions.php";
require_once "InterestManager.class.php";
if (!isset($_SESSION["id_from_db"])) {
    header("Location: login.php");
}
if (isset($_GET["logout"])) {
    session_destroy();
    header("Location: login.php");
}
// teen uue instansti class InterestManagerist
$InterestManager = new InterestManager($mysqli);
// aadressireal on new_interest
if (isset($_GET["new_interest"])) {
    // returniga tule response muutujasse $added_interest
    $added_interest = $InterestManager->addInterest($_GET["new_interest"]);
}
//rippmenüü valiku id
if (isset($_GET["dropdownselect"])) {
    //	saadan id ja kasutaja id
    $added_user_interest = $InterestManager->addInterest($_GET["dropdownselect"], $_SESSION["id_from_db"]);
}
?>

<p>
	Tere, <?php 
echo $_SESSION["user_email"];
?>
	<a href="?logout=1"> Logi välja</a>
</p>
開發者ID:janilv,項目名稱:10.tund,代碼行數:29,代碼來源:data.php


注:本文中的InterestManager::addInterest方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。