Results 1 to 4 of 4

Thread: Need help with required fields
      
   

  1. #1
    quyhurry's Avatar
    quyhurry is offline First Sergeant
    Join Date
    Nov 2005
    Location
    irvine, california
    Posts
    76

    Default Need help with required fields

    Hi all,
    I made this form using Pablo's way:
    http://www.nguyenthaihocfoundation.com/essay.html
    and the acknowledge php page:
    http://www.nguyenthaihocfoundation.com/ack.php
    Everything works fine.

    Now i wanted to validate required fields and made 3 more errors pages:
    http://www.nguyenthaihocfoundation.com/error_name.html
    http://www.nguyenthaihocfoundation.com/error_email.html
    http://www.nguyenthaihocfoundation.com/error_essay.html

    And try this script, using navaldesign's way:
    <?php
    @$Name = addslashes($_POST['Name']);
    @$Email = addslashes($_POST['Email']);
    @$Essay = addslashes($_POST['Essay']);
    if (strlen($Name) >40)
    {
    header("Location: error_name.html");
    exit;
    }
    if (strlen($Name) == 0 )
    {
    header("Location: error_name.html");
    exit;
    }
    if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $Email))
    {
    header("Location: error_email.html");
    exit;
    }
    if (strlen($Email) == 0 )
    {
    header("Location: error_email.html");
    exit;
    }
    if (strlen($Essay) == 0 )
    {
    header("Location: error_essay.html");
    exit;
    }
    $pfw_header = "From: $Email\n"
    . "Reply-To: $Email\n";
    $pfw_subject = "Data Submitted from Webform";
    $pfw_email_to = "duyanhvq@nguyenthaihocfoundation.com";
    $pfw_message = "Name: $Name\n"
    . "Email: $Email\n"
    . "Essay: $Essay\n"
    *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
    header("Location: ack.php");
    ?>

    I put the script inside body tag of ack.php and replaced the former one.
    It didn't work and got the message:
    Parse error: parse error, unexpected '@' in /home/nguyent/public_html/ack.php on line 60

    What did i do wrong? Please help. Thank you so much.
    Quy

  2. #2
    quyhurry's Avatar
    quyhurry is offline First Sergeant
    Join Date
    Nov 2005
    Location
    irvine, california
    Posts
    76

    Default Re: Need help with required fields

    I 'VE GOT IT !!!!
    My errors were:
    -. "Essay: $Essay\n" --> missed a ; at the end of the line
    -header("Location: ack.php"); --> totally wrong .
    I made a confirmation page and change to :
    header("Location: confirmation.html");

    I figured it out but breaking down the required fileds to ONE and did some testings

  3. #3
    mark d is offline Private
    Join Date
    Jun 2006
    Posts
    1

    Question Re: Need help with required fields

    I need a php script for required email fields. I would like a user to fill out required fields, click submit and I receive the required field information via email. After clicking the submit button the user is served a "thank you" page with information on it. Does anyone have a script? Thank you!

  4. #4
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,115

    Default Re: Need help with required fields

    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49