Validating a Form

need help validating my form before submitting

Page 1 of 1

4 Replies - 1397 Views - Last Post: 28 April 2009 - 06:22 AM Rate Topic: -----

#1 JVech   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 27-April 09

Validating a Form

Posted 27 April 2009 - 06:48 PM

i need to validate my input on my form using server-side validation. i need to post the form to itself for verification, and than if it passes; its verified, than i have to post it to ANOTHER page. How do i do that? :blink:
Is This A Good Question/Topic? 0
  • +

Replies To: Validating a Form

#2 Zerobu   User is offline

  • Black Hatter

Reputation: 13
  • View blog
  • Posts: 1,822
  • Joined: 14-January 08

Re: Validating a Form

Posted 27 April 2009 - 08:02 PM

You want to see if the form data is not empty? how about using the isset on the form variables after you extract them function.

Can you show us some code so we can help you more.

This post has been edited by Zerobu: 27 April 2009 - 08:03 PM

Was This Post Helpful? 0
  • +
  • -

#3 CTphpnwb   User is offline

  • D.I.C Lover
  • member icon

Reputation: 3837
  • View blog
  • Posts: 13,998
  • Joined: 08-August 08

Re: Validating a Form

Posted 27 April 2009 - 08:05 PM

View PostJVech, on 27 Apr, 2009 - 08:48 PM, said:

How do i do that? :blink:

By writing code.

This post has been edited by CTphpnwb: 27 April 2009 - 08:06 PM

Was This Post Helpful? 0
  • +
  • -

#4 SpaceMan   User is offline

  • D.I.C Addict
  • member icon

Reputation: 10
  • View blog
  • Posts: 507
  • Joined: 20-February 03

Re: Validating a Form

Posted 28 April 2009 - 05:00 AM

i usually make an array of field names i want checked, look for empty ones, trigger an error..

sudo code, debug and edit as needed.
like,
$required = array('Email','Name');

$errors = 0;
foreach($required as $i => $val){
if($_POST[$val] == '') $errors .= $val.' empty...<br>';
}

if($errors) exit($errors);

This post has been edited by SpaceMan: 28 April 2009 - 05:01 AM

Was This Post Helpful? 0
  • +
  • -

#5 Vomster   User is offline

  • D.I.C Head

Reputation: 13
  • View blog
  • Posts: 198
  • Joined: 15-May 08

Re: Validating a Form

Posted 28 April 2009 - 06:22 AM

I did it with JQuery.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1