Jump to content

problem with the variable


jimfog

Recommended Posts

When someone clisks the link below:

echo '<a href="'.$_SERVER["PHP_SELF"]. "?month= ". $prev_month ." &year= " .$prev_year. '">		    <img src="Images/prevmont_arrow.png" width="12" height="14" alt="previous month" /></a>'; 		  		   echo  '<div class="monthname">'.$monthNames[$cMonth - 1].''. $cYear.'</div>';

The month variable($cMonth) contained in div monthname gets reduced by one-here is the code which makes that possible($monthnames is just the array that contains the names of the month):

$prev_month = $cMonth-1;

Take a look at this code also:

 <a href="'.$_SERVER["PHP_SELF"]. "?day= ". $prev_day ."&monthcol=".$prevc_month."&yearcol=".$cprevyear.'">Previous day</a> <li>'.$cDay.'  '.$monthNames1[$cMonthcol- 1].'  '.$cYearcol.'</li>

I want-also-when the above link clicked-which diminishes the days-when a certain day is reached(for example 4), the month to be diminished also. that means, $prev_day accessing $cMonth-1($cMonth equals $_REQUEST["month"] = date("n")). I have tried numerous times to achieve the above but with no results. For example: if($cDay==4) {$cMonth-1;} What are my options?All variables listed are in global scope. The strange is, that, for example, the below code works:

if($cDay==4)  {echo $cMonth;}

IF you think the details i provide are not sufficient i can provide more.

Link to comment
Share on other sites

I am not sure about the purpose of the ccode?. What is the main objetive there? show us the relevant code please

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...