Jump to content

Session Value not displaying properly


watthehell
 Share

Recommended Posts

hi all.. back again

 

Now this time another problem (really a stupid one i think)

 

I have the function to display calendar

 

<?php

function DisplayCalender($id,$month,$year)

{

//code and stuffs goes here.. theres no problem in it

// here i stored the value of date in session

 

$_SESSION['mydate']=$currdate;

 

 

?>

 

and In the table part i echoed the $_SESSION value, but what happens is when the page loads the value of session does not come and when i refresh the page it comes.

 

Why is this happening, can someone help me ...

 

 

Link to comment
Share on other sites

Oops.. i didn't mean that

 

please have a look

 

I got this function

 

function DisplayCalender($id,$month,$year)

{

   

$date=date("d");

$month_curr=date("n");

$year_curr=date("Y");

 

// and i saved the value in session here

 

if($i==$date && $year_curr==$year && $month_curr==$month)

{

// save the curr date in session

$_SESSION['mycurrdate']=$year_curr.'-'.$month_curr.'-'.$i;

$_SESSION['myselecteddate']=$month_curr.'-'.$year_curr;

 

$_SESSION['currmonth'] = $month_curr;

$_SESSION['curryear'] = $year_curr;

 

$class_bg="cal_font_current";

$date_class="cal_font_current";

//$symbol1="car_curr";

//$symbol2="curr_sym";

}

 

// other codes

// end of function

}

 

And i called it here

 

<td width="212" height="35" align="center" valign="middle" bgcolor="#EB208C" class="cal_font_month" style="background-image:url(images/navigationbg.jpg);"><?php echo @$_SESSION['mycurrdate']; ?></td>

 

And after that i called the function

 

<td height="226" colspan="2" valign="top" bgcolor="#EB208C"><?
$id=1;
$month=date("n");
$year=date("Y");
DisplayCalender($id,$month,$year);
ob_end_flush();

 ?></td>

 

So any idea...

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.