Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder dniwebdesign's Avatar
    Join Date
    Dec 2003
    Location
    Carrot River, Saskatchewan
    Posts
    845
    Thanks
    15
    Thanked 10 Times in 10 Posts

    Different Script, Different Problem

    PHP Code:
    $t=date("j");
    $m=date("F");

    if(
    $m=="January" && $t="31")
        { 
    $thismonth="February"$thisday="1"; }
    else if(
    $m=="February" && $t="28")
        { 
    $thismonth="March"$thisday="1"; }
    else if(
    $m=="March" && $t="31")
        { 
    $thismonth="April"$thisday="1"; }
    else if(
    $m=="April" && $t="30")
        { 
    $thismonth="May"$thisday="1"; }
    else if(
    $m=="May" && $t="31")
        { 
    $thismonth="June"$thisday="1"; }
    else if(
    $m=="June" && $t="30")
        { 
    $thismonth="July"$thisday="1"; }
    else if(
    $m=="July" && $t="31")
        { 
    $thismonth="August"$thisday="1"; }
    else if(
    $m=="August" && $t="31")
        { 
    $thismonth="September"$thisday="1"; }
    else if(
    $m=="September" && $t="30")
        { 
    $thismonth="October"$thisday="1"; }
    else if(
    $m=="October" && $t="31")
        { 
    $thismonth="November"$thisday="1"; }
    else if(
    $m=="November" && $t="30")
        { 
    $thismonth="December"$thisday="1"; }
    else if(
    $m=="December" && $t="31")
        { 
    $thismonth="January"$thisday="1"; }
    else
        { 
    $thismonth=$m$today=$t+1; } 
    at the moment $m=September and &t=22 (today's date)... I am having problems as it keeps setting $thismonth and $today as October 1. I thought the "&&" meant both variables had to be true, not just 1.
    Dawson Irvine
    CEO - DNI Web Design
    http://www.dniwebdesign.com

  • #2
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    It does, but you have

    $t="1"

    which is always true. It should be
    $t=="1"

  • #3
    Regular Coder dniwebdesign's Avatar
    Join Date
    Dec 2003
    Location
    Carrot River, Saskatchewan
    Posts
    845
    Thanks
    15
    Thanked 10 Times in 10 Posts
    Ah... okay... i'll give that a shot later...
    Dawson Irvine
    CEO - DNI Web Design
    http://www.dniwebdesign.com


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •