+ Reply to Thread
Results 1 to 18 of 18

Thread: Required Fields
      
   

  1. #1
    matrixxxxxx1's Avatar
    matrixxxxxx1 is offline Captain
    Join Date
    Apr 2006
    Posts
    221

    Default Required Fields

    Hi
    Is Naval Design around plzzzzz or any other expert

    I have my form up and running, but would like to add required fields to name and email. this is my contact link. http://www.atexflooring.ca/contact.html
    I went over some of the threads here on the subject, however I kept runing into errors.

    this is the script I have in there as of now.
    I appreciate any help you guys can offer

    Thnx

    mike

    <?PHP
    $email = $HTTP_POST_VARS[email];
    $mailto = "me@mydomain.ca";
    $mailsubj = "Inquiry form Contact Us";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Customer Inquiry from Contact Us page:\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS))
    {
    $mailbody .= "$key : $val\n";
    }
    mail($mailto, $mailsubj, $mailbody, $mailhead);
    ?>

  2. #2
    Join Date
    Oct 2005
    Location
    England, UK
    Posts
    4,208

    Default Re: Required Fields

    Quote Originally Posted by matrixxxxxx1
    Hi
    Is Naval Design around plzzzzz or any other expert

    I have my form up and running, but would like to add required fields to name and email. this is my contact link. http://www.atexflooring.ca/contact.html
    I went over some of the threads here on the subject, however I kept runing into errors.

    this is the script I have in there as of now.
    I appreciate any help you guys can offer

    Thnx

    mike

    <?PHP
    $email = $HTTP_POST_VARS[email];
    $mailto = "me@mydomain.ca";
    $mailsubj = "Inquiry form Contact Us";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Customer Inquiry from Contact Us page:\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS))
    {
    $mailbody .= "$key : $val\n";
    }
    mail($mailto, $mailsubj, $mailbody, $mailhead);
    ?>
    I couldn't see your email on your site, but if you let me know it, I'll send you one of mine, that Naval did for me. You can then check line for line what you need. Would that help?

    VodaHost

    Your Website People!
    1-302-283-3777 North America / International
    07031847328 / United Kingdom

    ------------------------

    Top 3 Best Sellers

    Web Hosting - Unlimited disk space & bandwidth.

    Reseller Hosting - Start your own web hosting business.

    Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)



  3. #3
    matrixxxxxx1's Avatar
    matrixxxxxx1 is offline Captain
    Join Date
    Apr 2006
    Posts
    221

  4. #4
    Join Date
    Oct 2005
    Location
    England, UK
    Posts
    4,208

    Default Re: Required Fields

    Quote Originally Posted by matrixxxxxx1
    Thnx Amanda

    mike@atexflooring.ca


    mike
    On it's way, Mike.

    VodaHost

    Your Website People!
    1-302-283-3777 North America / International
    07031847328 / United Kingdom

    ------------------------

    Top 3 Best Sellers

    Web Hosting - Unlimited disk space & bandwidth.

    Reseller Hosting - Start your own web hosting business.

    Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)



  5. #5
    matrixxxxxx1's Avatar
    matrixxxxxx1 is offline Captain
    Join Date
    Apr 2006
    Posts
    221

    Default Re: Required Fields

    Quote Originally Posted by Girlonthehill
    On it's way, Mike.
    Thnx Amanda

    I'll have a look, hopefully I can figure it out.

    mike

  6. #6
    Join Date
    Oct 2005
    Location
    England, UK
    Posts
    4,208

    Default Re: Required Fields

    Quote Originally Posted by matrixxxxxx1
    Thnx Amanda

    I'll have a look, hopefully I can figure it out.

    mike
    Any time, hope it helps.

    VodaHost

    Your Website People!
    1-302-283-3777 North America / International
    07031847328 / United Kingdom

    ------------------------

    Top 3 Best Sellers

    Web Hosting - Unlimited disk space & bandwidth.

    Reseller Hosting - Start your own web hosting business.

    Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)



  7. #7
    matrixxxxxx1's Avatar
    matrixxxxxx1 is offline Captain
    Join Date
    Apr 2006
    Posts
    221

    Default Re: Required Fields

    This is like trying to learn chinese for the first time....lol

    Thnx Amanda, but I don't quite get it from your file. It's loaded with commands.

    Thnx anyways

    Mike

  8. #8
    Join Date
    Oct 2005
    Location
    England, UK
    Posts
    4,208

    Default Re: Required Fields

    Quote Originally Posted by matrixxxxxx1
    This is like trying to learn chinese for the first time....lol

    Thnx Amanda, but I don't quite get it from your file. It's loaded with commands.

    Thnx anyways

    Mike
    Yeah, it's a big form but the validation is only on the email addresses and contact (I think), thought maybe you could work it out. If not Naval or another expert will be along shortly. Hang on in there...

    VodaHost

    Your Website People!
    1-302-283-3777 North America / International
    07031847328 / United Kingdom

    ------------------------

    Top 3 Best Sellers

    Web Hosting - Unlimited disk space & bandwidth.

    Reseller Hosting - Start your own web hosting business.

    Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)



  9. #9
    matrixxxxxx1's Avatar
    matrixxxxxx1 is offline Captain
    Join Date
    Apr 2006
    Posts
    221

    Default Re: Required Fields

    I made email error page and name error page with this script from naval from another thread, but no luck


    <?PHP

    @$email = addslashes($_POST['email']);
    @$name = addslashes($_POST['name']);

    // Validation for empty fields
    if (strlen($email) == 0 )
    {
    header("Location: http://www.atexflooring.ca/email_errorpage.html");
    exit;
    }
    if (strlen($name) == 0 )
    {
    header("Location: http://www.atexflooring.ca/name_errorpage.html");
    exit;
    }

    $mailto = "mike@atexflooring.ca";
    $mailsubj = "Contact Us";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Values submitted from web site form:\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS))
    {
    $mailbody .= "$key : $val\n";
    }
    mail($mailto, $mailsubj, $mailbody, $mailhead);
    ?>



    I keep getting this error:

    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxx/public_html/feedback.php:7) in /home/xxxxxx/public_html/feedback.php on line 105


    Helpppppppp


    mike

  10. #10
    Join Date
    Oct 2005
    Location
    England, UK
    Posts
    4,208

    Default Re: Required Fields

    Quote Originally Posted by matrixxxxxx1
    I made email error page and name error page with this script from naval from another thread, but no luck


    <?PHP

    @$email = addslashes($_POST['email']);
    @$name = addslashes($_POST['name']);

    // Validation for empty fields
    if (strlen($email) == 0 )
    {
    header("Location: http://www.atexflooring.ca/email_errorpage.html");
    exit;
    }
    if (strlen($name) == 0 )
    {
    header("Location: http://www.atexflooring.ca/name_errorpage.html");
    exit;
    }

    $mailto = "mike@atexflooring.ca";
    $mailsubj = "Contact Us";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Values submitted from web site form:\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS))
    {
    $mailbody .= "$key : $val\n";
    }
    mail($mailto, $mailsubj, $mailbody, $mailhead);
    ?>



    I keep getting this error:

    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxx/public_html/feedback.php:7) in /home/xxxxxx/public_html/feedback.php on line 105


    Helpppppppp


    mike
    YIKES!!! I'm not that good at it either. I tried doing it myself a couple of weeks ago and messed it up royal. I think I should leave now and forget I ever helped you. Lol! You need expert help. Naval or someone else who understands it will be along soon - hold on in there. Sorry!

    VodaHost

    Your Website People!
    1-302-283-3777 North America / International
    07031847328 / United Kingdom

    ------------------------

    Top 3 Best Sellers

    Web Hosting - Unlimited disk space & bandwidth.

    Reseller Hosting - Start your own web hosting business.

    Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)



  11. #11
    matrixxxxxx1's Avatar
    matrixxxxxx1 is offline Captain
    Join Date
    Apr 2006
    Posts
    221

    Default Re: Required Fields

    Thnx for trying Amanda. I Aprecaite your effort.

    Mike

  12. #12
    matrixxxxxx1's Avatar
    matrixxxxxx1 is offline Captain
    Join Date
    Apr 2006
    Posts
    221

    Default Re: Required Fields

    Where are all the experts???


    Mike

  13. #13
    Join Date
    Mar 2006
    Location
    Mallorca, Spain
    Posts
    6,313

    Default Re: Required Fields

    mike,
    Its a jungle.......
    .
    here is the simplest one that actually works.......
    1 contact.bvp form
    1 contact.php file (ftp to main directory)
    3 error type .bvp forms.
    1 confirm.bvp form
    .
    <?PHP
    @$name = addslashes($_POST['name']);
    @$email = addslashes($_POST['email']);
    @$comments = addslashes($_POST['comments']);
    if (strlen($name) == 0 )
    {
    header("Location: nameerror.html");
    exit;
    }
    if (strlen($email) == 0 )
    {
    header("Location: emailerror.html");
    exit;
    }
    if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
    {
    header("Location: emailerror.html");
    exit;
    }
    if (strlen($comments) == 0 )
    {
    header("Location: http://mvpalma1.com/sales/commenterror.html");
    exit;
    }
    $mailto = "admin@mvtinia.com"; change this to your email
    $mailsubj = "Feedback from mvpalma1 form";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Values submitted from web site form:\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS))
    {
    $mailbody .= "$key : $val\n";
    }
    mail($mailto, $mailsubj, $mailbody, $mailhead);
    header("Location: http://mvpalma1.com/confirm.html");
    ?>

    see them working at either of my 2 sites below...

    Any probs, post again or you can email me....

  14. #14
    matrixxxxxx1's Avatar
    matrixxxxxx1 is offline Captain
    Join Date
    Apr 2006
    Posts
    221

    Default Re: Required Fields

    Quote Originally Posted by davidundalicia
    mike,
    Its a jungle.......
    .
    here is the simplest one that actually works.......
    1 contact.bvp form
    1 contact.php file (ftp to main directory)
    3 error type .bvp forms.
    1 confirm.bvp form
    .
    <?PHP
    @$name = addslashes($_POST['name']);
    @$email = addslashes($_POST['email']);
    @$comments = addslashes($_POST['comments']);
    if (strlen($name) == 0 )
    {
    header("Location: nameerror.html");
    exit;
    }
    if (strlen($email) == 0 )
    {
    header("Location: emailerror.html");
    exit;
    }
    if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
    {
    header("Location: emailerror.html");
    exit;
    }
    if (strlen($comments) == 0 )
    {
    header("Location: http://mvpalma1.com/sales/commenterror.html");
    exit;
    }
    $mailto = "admin@mvtinia.com"; change this to your email
    $mailsubj = "Feedback from mvpalma1 form";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Values submitted from web site form:\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS))
    {
    $mailbody .= "$key : $val\n";
    }
    mail($mailto, $mailsubj, $mailbody, $mailhead);
    header("Location: http://mvpalma1.com/confirm.html");
    ?>

    see them working at either of my 2 sites below...

    Any probs, post again or you can email me....

    Thnx alot David, I appreciate your help
    I did as you mentioned and it seemed to work right away, then i'm not sure what i did, but the problem I'm having now is it keeps redircting me to http://www.atexflooring.ca/www.atexflooring.ca/nameerror.html
    http://www.atexflooring.ca/www.atexflooring.ca/emailerror.html
    I can't get it to just go to www.atexflooring.ca/nameerror.html or www.atexflooring.ca/emailerror.html
    it keeps going twice www.mydomain/error/www.mydomain/error
    I checked the script over and over. I have no idea why it's doing that
    The confirmation page is working but not the error pages due to links.

    I just wanted to do name and email for required fields...Can you check this for errors plz

    <?PHP
    @$name = addslashes($_POST['name']);
    @$email = addslashes($_POST['email']);
    if (strlen($name) == 0 )
    {
    header("Location: www.atexflooring.ca/nameerror.html");
    exit;
    }
    if (strlen($email) == 0 )
    {
    header("Location: www.atexflooring.ca/emailerror.html");
    exit;
    }
    if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
    {
    header("Location: www.atexflooring.ca/emailerror.html");
    exit;
    }
    $mailto = "mike@atexflooring.ca";
    $mailsubj = "Feedback from atex flooring form";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Customer inquiry from contact us:\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS))
    {
    $mailbody .= "$key : $val\n";
    }
    mail($mailto, $mailsubj, $mailbody, $mailhead);
    header("Location: http://atexflooring.ca/confirm.html");
    ?>




    mike

  15. #15
    matrixxxxxx1's Avatar
    matrixxxxxx1 is offline Captain
    Join Date
    Apr 2006
    Posts
    221

    Smile Re: Required Fields

    Finally It's working

    David you're my hero
    Thnx a bunch. I appreciate all your help.


    Mike

  16. #16
    Join Date
    Mar 2006
    Location
    Mallorca, Spain
    Posts
    6,313

    Default Re: Required Fields

    Mike,
    Just went to your site and tested both fields with and without values
    and both are working FINE.......
    Did you get my two emails ???

    btw: the back buttons are fine on your error pages
    but I dont think its required on your confirmation page as you have your
    menu buttons available.......

    enjoy

  17. #17
    Join Date
    Mar 2006
    Location
    Mallorca, Spain
    Posts
    6,313

  18. #18
    matrixxxxxx1's Avatar
    matrixxxxxx1 is offline Captain
    Join Date
    Apr 2006
    Posts
    221

    Default Re: Required Fields

    Quote Originally Posted by davidundalicia
    Mike,
    Just went to your site and tested both fields with and without values
    and both are working FINE.......
    Did you get my two emails ???

    btw: the back buttons are fine on your error pages
    but I dont think its required on your confirmation page as you have your
    menu buttons available.......

    enjoy
    Thnx David

    The confirmation page, I wanted that page to appear for few seconds and go back on its own to the previous page without the visitor having to click back or anything, but I'll settle for this.

    I got your emails. Thnx for testing out the form.

    Mike

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