Menu

Ver 205 - "did not enter a valid number"

Help
Anonymous
2003-04-25
2003-04-25
  • Anonymous

    Anonymous - 2003-04-25

    First,
    Thanks for pulling this app together!!

    Tried both versions 205 and 204. Did the chmod -R 777 forms. etc.

    Get 1st screen; enter (variously) 5 or 22 or 05 or "5" , etc...
    Get 2nd screen stating:
    "You did not enter a valid number. Please use a number between 1 and 99."

    Tried entering via numeric keypad and on numbers at top of QWERTY...still no luck...

    Looks like error being triggered at in fields.php:178

    Any tips on debugging at this end???

    Thanks,
    Chuck

     
    • Anonymous

      Anonymous - 2003-04-25

      {Hit enter to quick}

      The var $fields is capturing the input number, ie. 22

      Thanks again...

      Chuck

       
    • Musawir Ali

      Musawir Ali - 2003-04-25

      you have to enter an integer value without leading zeros, or any other characters. 5 and 22 both should work. Try the demo site: http://phpformgen.sourceforge.net/phpform .

       
    • Anonymous

      Anonymous - 2003-04-25

      Thanks for the quick response!!!

      (Using Ver 205 - and wishing I could test faster...)

      I agree, and I had entered for example a single number, just "5" or "22" (no quotes, spaces, etc.).
      (Fun to describe clearly online sometimes isn't it - lol)

      Further testing results:

      in fields.php, (178) I had to take out the ^ (start with) in the ereg to get it to accept the numeric (only) input. Humm... didn't look like the removal of '^' should have been necessary.
      Using RH8 php422 on test box...

      Bottom Line: functioning with the tweak in the ereg ref'd above.

      FWIW,
      (and __Thanks!!__)
      Chuck

       
    • Musawir Ali

      Musawir Ali - 2003-04-25

      removing the ^ will defeat the purpose. Someone could enter "abc22" and that'll still work with the removal of ^

       
    • Anonymous

      Anonymous - 2003-04-25

      Thanks for the quick response!!!

      (Using Ver 205 - and wishing I could test faster...)

      I agree, and I had entered for example a single number, just "5" or "22" (no quotes, spaces, etc.).
      (Fun to describe clearly online sometimes isn't it - lol)

      Further testing results:

      in fields.php, (178) I had to take out the ^ (start with) in the ereg to get it to accept the numeric (only) input. Humm... didn't look like the removal of '^' should have been necessary.
      Using RH8 php422 on test box...

      Bottom Line: functioning with the tweak in the ereg ref'd above.

      FWIW,
      (and __Thanks!!__)
      Chuck

       
    • Anonymous

      Anonymous - 2003-04-25

      (Sorry for the double post... guess the net hiccupped...)

      Valid point...
      Testing in fields.php using number 2 as input:
      if(!ereg("^([1-9]{1})([0-9]{0,1})$",$fields))
      {
      $errors++;
      $error.="<li> You did not enter a valid number. Please use a number between 1 and 99. <BR>VALUE OF FIELDS is: $fields ";
      }

      yields:

           *  You did not enter a valid number. Please use a number between 1 and 99.
      VALUE OF FIELDS is: 2fields=2

      Humm.... off to check things out...

      Thanks,
      Chuck

       
    • Musawir Ali

      Musawir Ali - 2003-04-25

      Yea..

      ^([1-9]{1})([0-9]{0,1})$

      ^ means the string should start here
      [1-9]{1} means the first character should be a digit between 1 and 9
      [0-9]{0,1} means there be zero or one digit(s) between 0 and 9
      $ end of string

      so this guarantees a number between 1 and 99

       
    • Anonymous

      Anonymous - 2003-04-25

      (Sorry for the double post... guess the net hiccupped...)

      Valid point...
      Testing in fields.php using number 2 as input:
      if(!ereg("^([1-9]{1})([0-9]{0,1})$",$fields))
      {
      $errors++;
      $error.="<li> You did not enter a valid number. Please use a number between 1 and 99. <BR>VALUE OF FIELDS is: $fields ";
      }

      yields:

           *  You did not enter a valid number. Please use a number between 1 and 99.
      VALUE OF FIELDS is: 2fields=2

      Humm.... off to check things out...

      Thanks,
      Chuck

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.