1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Register script help

Discussion in 'PHP' started by im-not-alive, Mar 20, 2008.

  1. #1
    Well recently I created a simple register script that saves the user name/password along with some other information into a text file. It works great except for one thing, some people user invalid characters in their user name (¿, ñ, ╥, etc.) causing server errors, and I need a fix for it because I simply can't think of one. Thanks in advance!
     
    im-not-alive, Mar 20, 2008 IP
  2. RoscoeT

    RoscoeT Peon

    Messages:
    78
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try this function to test if a string is alpha numeric.

    http://ca3.php.net/manual/en/function.ctype-alnum.php

     
    RoscoeT, Mar 20, 2008 IP
  3. RoscoeT

    RoscoeT Peon

    Messages:
    78
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Or, also you could make a function with an array that contains all your acceptable characters and test the strings against it.
     
    RoscoeT, Mar 20, 2008 IP
  4. im-not-alive

    im-not-alive Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yeah, thats what I was thinking. Thanks for the help mate.
     
    im-not-alive, Mar 20, 2008 IP