ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Strange Date Error

July 22, 2008 4:11am

Subscribe [1]
  • #1 / Jul 22, 2008 4:11am

    Davmit

    11 posts

    Hi Friends,

    i have come across a strange problem in the date calendar.
    i have set up a calendar in a template.

    So an example URl would be :
    http://mysite.com/index.php/calendar/2008/05

    Now, in the above url {segment_3} = 05.
    I am assigning this value to a PHP variable in the template as below.

    <?php $cal_month = {segment_3}; ?>

    Now for all months its working fine EXCEPT August and September.  :gulp:
    The value in the $cal_month variable is 0 if August or September comes in the url.

    i.e. if URLS are http://mysite.com/index.php/calendar/2008/08 OR
                http://mysite.com/index.php/calendar/2008/09

    then $cal_month = 0 , if i print {segment_3} it shows the proper value for all.

    Why is this happening?
    For all other months it shows the right value.

    Strange error

    Thanks,
    Davmit

  • #2 / Jul 22, 2008 4:38am

    Davmit

    11 posts

    OK Solved it myself

    just changed my php code

    From :
    <?php $cal_month = {segment_3}; ?>

    To:
    <?php $cal_month = “{segment_3}”; ?>

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases