Checking entries of textfield

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mickeymauz
    New Member
    • Aug 2000
    • 3

    Checking entries of textfield

    Does someone have the code for PHP that will validate a text field only is alphanumeric characters? I would like to ommit all the !@#$%^&*()`=+,./<>?. Thanks
  • Anscoop
    Member
    • Jul 2000
    • 38

    #2
    [[:alnum:]] is a character class built into PHP, that you can use.

    Comment

    • TechTalk
      Senior Member
      • Jul 2000
      • 769

      #3
      Assuming "somefield" is the name of your text field that is being checked:

      Code:
      ereg("([0-9a-zA-Z])",$somefield)
      HTH

      ~Chris

      Comment

      • mickeymauz
        New Member
        • Aug 2000
        • 3

        #4
        What if I want to find it in the middle of a field?

        Comment

        Related Topics

        Collapse

        Working...