#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    LONDON
    Posts
    3
    Rep Power
    0
    I would like to have help on my php3 form. My form inserts into a MySQL database the fields I speficify but doesn't validate the information entered in all the fields.

    I would like it to display a message if there is 1+ field not entered and if successful i would like the page redirected to a thankyou page.

    Please help.....
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    36
    Rep Power
    15
    How about:
    <?php
    if (!($var1)&#0124; &#0124;!(var2)) {
    print "You did not fill in all of the fields.";
    }
    else {
    include your thank you page or put in the code here
    }

    If you want to test for individual variables just do individual if statements for each variable, that way your user will know which variable is missing.ie:

    <?php
    $x=0;
    if (!($var1)){
    print "You did not fill in variable1";
    $x=1;
    }
    if (!($email)){
    print "You did not fill in email";
    $x=1;
    }
    if ($x==0) {
    include your thank you page or put in the code here for it
    }

Similar Threads

  1. Post back and Expired page
    By bonzaitrimmer in forum .Net Development
    Replies: 8
    Last Post: September 27th, 2004, 09:02 AM
  2. Customised home page....explain?
    By gat in forum PHP Development
    Replies: 3
    Last Post: February 12th, 2004, 01:33 PM
  3. Replies: 2
    Last Post: February 4th, 2004, 11:10 PM
  4. Validate a form using same page as form
    By annihilate in forum PHP Development
    Replies: 20
    Last Post: February 4th, 2004, 08:56 PM
  5. need help with testing non-alphanumeric input
    By pinkipodmini in forum PHP Development
    Replies: 1
    Last Post: January 23rd, 2004, 01:48 PM

IMN logo majestic logo threadwatch logo seochat tools logo