Results 1 to 4 of 4

Thread: Form Validation

  1. #1

    Thread Starter
    Addicted Member TheGoldenShogun's Avatar
    Join Date
    Mar 2001
    Location
    VA/MD... anywhere around the beltway
    Posts
    236

    Cool Form Validation

    Heres a tricky one, I'm working on a bulletin board (The Hobo's thread inspired me to try) and its going all well but I'm worried about one thing. What I do is I take their input for a thread from the textarea and run it through a php function that does some standard str_replaces... but my problem is, how do I know when to take out stuff if they slap a <? in the textarea. I don't want them to put <? phpinfo() ?> in the message of my message board and then it print out the actual php info or other things. How can I avoid that?

  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    Run their input through the htmlspecialchars function, it will solve all your problems at once

  3. #3

    Thread Starter
    Addicted Member TheGoldenShogun's Avatar
    Join Date
    Mar 2001
    Location
    VA/MD... anywhere around the beltway
    Posts
    236
    wow, thats a great function, I never knew they had that. Thanks.

  4. #4
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    yep, PHP is full of little gems like that

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width