How Do You Validate Your Forms?

free web hosting
Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

How Do You Validate Your Forms?

dark
Hi

Do you validate your forms using PHP , javascript or both?
I was just playing around with a tutorial for a very simple guestbook and the creator did use both javascript and php to validate.

Thanks

Patrick

Reply

FaLgoR
validate the forms? I did not understand, but I use PHP:

for <input name="name">:
if(!$name){
print "You can't let the input "name" in blank.";
exit;
}

for long forms:
if(!$name || !$email || !$age){
print "You can't let any input in blank.";
exit;
}

Reply

LuciferStar
QUOTE(dark @ Jan 5 2005, 05:04 PM)
Hi

Do you validate your forms using PHP , javascript or both?
I was just playing around with a tutorial for a very simple guestbook and the creator did use both javascript and php to validate.

Thanks

Patrick
*



I'd prefer using both of them.
the form data needn't to be send by using javascript

Reply

no9t9
if php is available, it is the best method to evaluate forms. This is because some people have javascript disabled. If you use javascript, your form will not work in this case. Using php means the server does the work.

Plus, php is very simple. Just a bunch of IF statements and you are done. All my forms are done in php and I don't even have to use a seperate file. Just need an IF (!submit) {display form} ELSE {validate form}

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : validate forms

  1. Restrictions On Php & Forms? - $_GET/POST/REQUEST? (2)
  2. Php & Forms Question - (2)
    okay, so i have a form on a php script i am working on, and i want the form to submit to the page it
    is on... CODE echo "<form action=\"" .
    $_SERVER['REQUEST_URI'] . "\"
    method=\"GET\"> \n"; so say the page it loads on is something like
    index.php?page=article&id=8 when i submit the form, it ignores the query string and just goes back
    to index.php i tried something like CODE $action =
    $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_S...
  3. [php]simple Flat File Text Manipulator - Example on how to use forms to write to files in PHP (3)
    I made a simple flat file text editor, that can show you probably how simple it is to use forms with
    php and write that data to file. This example has 2 files, submit.php, and postit.html. Submit.php
    is used to write title, and some text, and add html tags, and paragraph tags where new paragraphs
    are. Here's the file with comments. I think that HTML really doesn't need some more
    explaining. CODE Title: <br /> <input type="text"
    name="title" size="53"> <br /> Text: <br />
    <textarea nam...
  4. Forms, Text Files, And Php For A Signature Generator. - Help a little. (1)
    Hello everyone! I am in need of some code a for a signature generator I am making. I am using
    BuffaloHELP's code for the php file, now I am trying to improve that code by making a form in a
    html file that will have the user say what is on the sig! But now, I need help getting the form
    data that is posted by the user to get into that sig! There is a file, sig.txt, where that tells
    the php file what text will go on the sig. But how can I make the form data in the html file go into
    the text file so it will go onto the sig? You might want to read BuffaloHELP&...
  5. Protecting Web Email Forms - (3)
    i have a web form on my site which can be filled in with a customers email, name and question or
    comment. when the form is submitted an email is sent to an address i setup with all the info.
    recently i've been getting alot of spam/junk coming from the web form. for the most part, they
    usually come pretty close together, which makes it seem like just one spammer (at least at a time).
    also i'm talking like 5-10 messages at a time. i'm wondering if people have any
    suggestions how to protect these types of web forms from spammers. any ideas/help is appreciate...
  6. Php Contact Form - contact forms made easy... (7)
    Here is a simple script to make a contact form with PHP. First off you make a simple contact form,
    insert the following into any page: CODE <form method="post"
    action="form.php"> Name:<input name="name" type="text"
    id="name"><br> Email:<input name="email" type="text"
    id="email"><br> Subject:<input name="subject"
    type="text" id="subject"><br> Message:<textarea
    name="comments" id="textarea"&...



Looking for validate, forms

Searching Video's for validate, forms
advertisement



How Do You Validate Your Forms?



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE