Results 1 to 8 of 8
  1. #1

    php <form> question

    I have a form that i want to send to an different location, but i want to have a way to validate the information inthe for before it's sent off via post to it's final dest.

    the form is in php and html, and i need a way to make sure that all the information is right before i send it off (it's going to bank of america)

    any suggestions?

  2. #2
    Join Date
    Mar 2004
    Granville OH
    If it's the format of the information that you need to check regular expressions are the way to go. Do a search on it, you'll get plenty. They're messy and there's a knack to it, but it's one of the better ways to make sure information is in a particular format.

    If it's the validity of the information then you need to find resources to check against. This will often come in the form of using sockets or pipes to get the information from another program. Sadly there are far too many "standardized" methods of doing this sort of thing, so it's really on a case by case basis.

  3. #3
    Join Date
    Nov 2003
    You can verify if the given information is valid or not by using JavaScript, which runs on the client side. It will send the verified information to its destination.
    "An army of sheep led by a lion would defeat an army of lions led by a sheep"

  4. #4
    Join Date
    Feb 2004

    Use Javascript to validate all your parameters in your form. You can use javascript in PHP so that all the parameters will be validated at the client side so that you will be aware of all parameters before sending to the destination. Also write the javascript in such a way that you can view the filled form before sending it to the client. For details how to embed JAVASCRIPT in PHP please have a look into



  5. #5
    Join Date
    Jul 2003
    If you use javascript -- people that have disabled javascript (yes, there are some) -- or people using a browser that doesn't support javascript (yes, there are some) will be able to send un-verified data.

    The best verification is serverside, where you are guaranteed the data an dcan control the verification process.

    Once you have verified the data, you can use PHP to generate a POST request to the server (basically, creating a browser in PHP) and send it off to BoA. There are a few PEAR classes that can help you with it.
    In order to understand recursion, one must first understand recursion.
    If you feel like it, you can read my blog
    Signal > Noise

  6. #6

    Our contact form has validation, I believe our developers did it entirely in PHP (Form made with HTML), basically the same way you've made yours. I am unsure of the code, however if you look up PHP form validation, I'm sure you'll find what you're looking for.

    Paul B. Riddick
    Web hosting done right
    ██ Shared, Reseller and Dedicated web hosting
    An Easy Web Presence Company

  7. #7
    Join Date
    Jan 2003
    Perth, WA, Australia
    I usually validate serverside, but if you want it to be done in realtime (without refreshing the page, and before sending the data), then use JavaScript.

    You should also validate server side anyway, incase someone decides to copy your form and remove the JavaScript validation and then fill out the form on their own server and have it send to your script.

    Having either just serverside validation or both JavaScript and serverside will weed out these types of people (and still validate for people without JavaScript enabled), while allowing for the people who both have JavaScript enabled and are completing the form correctly won't be made to wait for page refreshes. :: coming soon

  8. #8
    All of you have been a real help. I'll post my results later on what I chose to do.

    Thanks again.

Posting Permissions

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