I'm trying to turn a PHP question into a Javascript one..

Discussion in 'JavaScript' started by haipravu, Jul 5, 2007.

  1. #1
    I'm trying to turn a PHP question into a Javascript one.


    else if(strcasecmp($person, $name) == 0 && $code!== $password ¦¦!empty($another_person) && $code!== $another_password )

    Some of the values are taken from a form and some are taken from a database. I can already turn the form vaules into Javascript ones, but how do I make the database/php values work in Javascript?

    Also, I'm guessing the question is pretty much the same in Javascript, but what of the strcasecmp function? I've looked around to see if there's a js equivalent but found nothing.

    Is there Javascript resource site like php.net? Something that has the Javascript documentation.
     
    haipravu, Jul 5, 2007 IP
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    The equivalent to strcasecmp on Javascript is the match function. It operates with regular expresions where you'll need to add the "i" modifier to "ignore case".
    Brief example.
    But you can search for: javascript regular expressions
     
    ajsa52, Jul 5, 2007 IP