check input from textbox

Discussion in 'Programming' started by kabucek, Jan 15, 2009.

  1. #1
    hi all,
    i have this piece of code to check the textbox input:

    $selectedProdCode="LMQ";
    if ($memberDataArray['eventDate']="FEBRUARY 28")   //changed from ttevents
     {
        $selectedProdCode="febevent";
             }
    
     elseif ($memberDataArray['eventDate']='ttevents')
     {
        $selectedProdCode="ttevents";
             }
    PHP:
    - with this i want to check:
    if user types: FEBRUARY 28 in the box the system will select febevent

    if user tyeps: ttevents in the box the system will select ttevents


    somehow it doesn't work, it selects febevent all the time.

    thanks!
     
    kabucek, Jan 15, 2009 IP
  2. gnp

    gnp Peon

    Messages:
    137
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I believe that php equal operator is == and not =.

    Try correcting this as it is a common mistake ..
     
    gnp, Jan 15, 2009 IP
  3. kabucek

    kabucek Guest

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    didn't work.
     
    kabucek, Jan 15, 2009 IP
  4. gnp

    gnp Peon

    Messages:
    137
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    sorry it did not help ...

    i am not a php coder (tried to help since it is a common mistake in other languages..)

    Have you tried outputting the contents of $memberDataArray['eventDate'] to see what it has stored ?
     
    gnp, Jan 15, 2009 IP