Php Help - Form[textbox control]

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • qiqinuinaifen128
    New Member
    • Dec 2007
    • 10

    Php Help - Form[textbox control]

    Hi,

    I have some questions regarding the php

    I have a form and there are several text box for user input text.

    Is it possible to use php to control the input?

    What i want is user must key in .html or .php at the end of the text. No Capital letter and space as well as symbol accept . and -

    What is the code look like?

    Hope i can help from here.

    Thanks you in advances

    Best Wish
  • devsusen
    New Member
    • Feb 2007
    • 136

    #2
    You need to use php form validation class that generates client side validation(java script validation) too. You can use HTML_QuickForm from PEAR or validator from phpclasses.

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      Originally posted by devsusen
      You need to use php form validation class that generates client side validation(java script validation) too. You can use HTML_QuickForm from PEAR or validator from phpclasses.
      You don't need to.

      qiqinuinaifen12 8,

      We do not just give out code. We can direct you to resources and help you with specific problems with code that you have attempted to write.

      You can use regular expressions to check the user input.

      Comment

      • TheServant
        Recognized Expert Top Contributor
        • Feb 2008
        • 1168

        #4
        What you want to look at is form validation. It is recommended to use two levels of validation. Using PHP when processing the form is a must, so checking the data sent is not malicious (like SQL injection etc) and also checking it is the data you want (in this case with the correct extension).

        The other possible validation which I have a feeling you are referring to is javascript which will check the input before the form is sent. This saves on user time as the check is practically instant with no page load, and also saves the server having to process the form. It cannot be used alone because a small percentage of internet users have javascript disabled, and malicious people will disable it anyway.

        All these terms I have used like form validation, SQL injection, etc can be looked up on Google for definitions.

        Comment

        Working...