Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I have a variable that is losing it's value and I am very confused about it ... I would appreciate any help I can get.
Here is the code:Code: Select all
session_start();
define('GARDENPARTY_DIR', 'path on my server');
include(GARDENPARTY_DIR . 'libs/gardenmem_setup.php');
$garparmem=& new GardenMember;
$garparmem->identity = ($_REQUEST['viewkey']); // this is the value that is "disappearing"
// these two lines recently added to experiment with the variable that is "losing" it's value.
$_SESSION[identity] = $garparmem->identity;
$identity = $_SESSION[identity];
$_action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'enter';
switch($_action) {
case 'enter':
$today = date("Y-m-d H:i:s");
// please note the assignment of $garparmem->identity is working and all actions in this case work as intended.
$meminfo = $garparmem->logMemberIn ($garparmem->identity);
$partyID = $meminfo[0]["PartyID"];
$partyInfo = $garparmem->getPartyInfo($partyID);
$hostSubsidy = $partyInfo[0]["PartyHostSubsidy"];
$hostSubsidyPercent = ((100-$hostSubsidy)/100);
$ItemIDs = $garparmem ->getPartyItems ($partyID);
$itemCount = count($ItemIDs);
for($i=0;$i<$itemCount;$i++)
{
$ItemID=$ItemIDs[$i]["ItemID"];
$MenuData = $garparmem ->getPartyMenuDetails ($ItemID);
$totalPrice = $totalPrice + $MenuData[$i]["ItemPrice"];
}
$WillAttend = $garparmem ->getRepliedList ($partyID);
$showComing = count($WillAttend);
$NoReplyData = $garparmem ->getNotRepliedList ($partyID);
$adjustedPrice = $hostSubsidyPercent*$totalPrice;
$MemViewKey = $_SESSION[identity]; // this line was recently added to help experiment with the variable that is losing its value aka Hack.
$garparmem->dsplyReplyPage($NoReplyData,$WillAttend,$meminfo,$partyInfo,$MenuData,$itemCount,$adjustedPrice,$hostSubsidy,$showComing);
break;
// the following case is where I lose the variable value;
case 'reply':
$willAttend = $_POST["response"];
$Message = $_POST["message"];
$carpool = $_POST["CarPool"];
if ($carpool != 1){
$carpool =0;
}
$emailme = $_POST["emailMe"];
if ($emailme != 1){
$emailme =0;
}
$garparmem->updateMemStatus($identity,$willAttend,$Message,$carpool,$emailme,$identity);
echo "Updated ... go check it out";
break;
}
?>Hopefully, all of that made sense.
And Yes, I am a PHP Noob
TIA
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]