hiding in php - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

hiding in php

pdunnpdunn Posts: 63Member
Is there anyway to do this?

if not, since I couldn't find anything on the web except for one unanswered post. Is there a way so, after the user submit a form, I can use php w/Javascript to test if all the fields are entered. How do I get a post in Javascript? I know about making "onButtonClick" and that, but php seems to care about the method of posting. Is this possible. If not, does anyone know a good validation method that will use php?

Thank you,

pdunn

Comments

  • daviestrachandaviestrachan Posts: 26Member
    You should use javascript to validate form.






    >
    your name:
    your email:

    your opinion:






    Use POST OR GET depending on data in form
    See specs


    The HTML specifications technically define the difference between "GET" and "POST" so that former means that form data is to be encoded (by a browser) into a URL while the latter means that the form data is to appear within a message body. But the specifications also give the usage recommendation that the "GET" method should be used when the form processing is "idempotent", and in those cases only. As a simplification, we might say that "GET" is basically for just getting (retrieving) data whereas "POST" may involve anything, like storing or updating data, or ordering a product, or sending E-mail.

    Regards Davie

  • ITAITA Posts: 463Member
    I'm not entirely sure what you mean... What would you like to do - do you want to know how to validate a form with PHP? I recommend, that even if you validate your form with JavaScript, then you should also validate it with PHP too - because someone may just turn JS off in their browser, and send in a load of junk data to your script.

    You can retrieve the values posted from your form with the $_POST variable - if you're sending with GET, then you can use $_GET, or if you want to deal with both (for whatever reason) you can also use $_REQUEST.

    The reason I'm unsure about how to respond, is the title, which does not appear to be linked with the message. Please could you give some more detail.

    Thank you.

    Isaac
    "Let us smite the evil slime eating hordes who may befall us on our quest to be the ultimate programmers of the known universe!"

Sign In or Register to comment.