Results 1 to 11 of 11

Thread: cant see the forest for the trees - verifying fields
      
   

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

    Default cant see the forest for the trees - verifying fields

    Hi all,
    I am a great believer in self help and therefore have searched and read and viewed and visited other peoples websites who have had this same problem.
    .
    Using pablos very good description, I have created my contact.bvp form
    and also created my confirm.bvp form saved as php.
    Published both and all are working OK......
    .
    Now, I would like to have the 3 simple fields (name, email, and comments) verified using the (If strlen ) coding as found during above searches.
    .
    Is it just a case of adding these simple lines or is something else required as I
    keep getting error messages.
    .
    I have reverted to the original code for now
    until some kind person points me in the right direction......

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

    Default Re: cant see the forest for the trees - verifying fields

    Greetings David,

    Aren't they a nightmare? I've found this which deals with validation of correct format of email and a contact name:

    http://www.vodahost.com/vodatalk/for...ript-help.html Post #9

    One of Naval's, obviously, maybe you could check your validation bits against it? If it doesn't help - send up a flare!

    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
    Join Date
    Mar 2006
    Location
    Mallorca, Spain
    Posts
    6,313

    Default Re: cant see the forest for the trees - verifying fields

    Hi Amanda, where the heck are the flares !!!!!
    .
    its something simple like this that I am looking for

    if (strlen($COMMENT) == 0 )
    {
    header("Location: upload_error.html");
    exit;
    }

    but when I copy and paste into my existing confirm.bvp and republish as php
    thats when I get a the warning message.....

    I have viewed most of navals posts but all seem to involve notepad and ftp
    and I am trying to keep this simple......

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

    Default Re: cant see the forest for the trees - verifying fields

    oh.... heres my original script for those that cannot read my mind......oops
    .

    <?PHP
    $email = $HTTP_POST_VARS[email];
    $mailto = "me@myplace.com";
    $mailsubj = "Feedback from 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);
    ?>

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

    Default Re: cant see the forest for the trees - verifying fields

    Quote Originally Posted by davidundalicia
    oh.... heres my original script for those that cannot read my mind......oops
    .

    <?PHP
    $email = $HTTP_POST_VARS[email];
    $mailto = "me@myplace.com";
    $mailsubj = "Feedback from 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);
    ?>
    The simplest way, for most, is to paste the script into notepad (start>all programs>accessories>notepad). Save as (change the file type to All Files) and save as example.php

    Open the file publish tool in any BV page (left hand menu - globe with arrow pointing north). Double click the box that appears and browse for your php file don't worry where on the page it is as it only acts as a basket to carry files and does not show up on the page). Then publish the BV page, as normal. When the page is successfully publish - delete the file upload box from your BV page.

    This should have placed your php script safely in your public.html folder (or wherever you have saved it) from where your pages can access it.

    If I am, in an effort to help, 'teaching my Grandmother to suck eggs', I apologise! I hope this does assist you.

    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)



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

    Default Re: cant see the forest for the trees - verifying fields

    Hi amanda,
    Please dont apologise as any reply is allways useful....

    The whole point of this exercise is to try and find a way to verify form fields
    without using notepad, ftp or the carrier. In other words, to continue the simple way of creating forms as described by Pablo and continued by Naval.
    .
    In my mind, there have been many, many posts for help on this same subject
    and if we could simplify this by using the publishing method then we would be helping a lot more people.....
    .
    I am fairly new with bv and vh but I am learning something new each day...
    Here is my latest attempt
    <?PHP
    @$name = addslashes($_POST['name']);
    @$email = addslashes($_POST['email']);
    if (strlen($name) == 0 )
    {
    header("Location: error.html");
    exit;
    }
    if (strlen($email) == 0 )
    {
    header("Location: error.html");
    exit;
    }
    if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
    {
    header("Location: error.html");
    exit;
    }
    $email = $HTTP_POST_VARS[email];
    $mailto = "admin@mvtinia.com";
    $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);
    ?>

    Can Anyone point me in the right direction ????

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

    Default Re: cant see the forest for the trees - verifying fields

    <?PHP
    @$name = addslashes($_POST['name']);
    @$email = addslashes($_POST['email']);
    if (strlen($name) == 0 )
    {
    header("Location: error.html");
    exit;
    }
    if (strlen($email) == 0 )
    {
    header("Location: error.html");
    exit;
    }
    if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
    {
    header("Location: error.html");
    exit;
    }
    $email = $HTTP_POST_VARS[email]; Delete this line. You have already defined $email above
    $mailto = "admin@mvtinia.com";
    $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: thankyou_page.html");

    ?>

    All the rest seems correct, BUT YOU HAVE TO UPLOAD IT IN THE NOTEPAD METHOD: the headers in the script might conflict with the html code if you paste it in a BV page. That's why i have added the line in red
    Last edited by navaldesign; 04-25-2006 at 08:02 PM.
    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!


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

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

    Default Re: cant see the forest for the trees - verifying fields

    Please create and publish the thankyou page. You will need it to redirect the visitor after submission.
    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!


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

    Default Re: cant see the forest for the trees - verifying fields

    naval, I now have my contact page, my confirm page and a php file uploaded but with the below I still am getting a warning message....

    can you check below.....thanks....

    <?PHP
    @$name = addslashes($_POST['name']);
    @$email = addslashes($_POST['email']);
    if (strlen($name) == 0 )
    {
    header("Location: error.html");
    exit;
    }
    if (strlen($email) == 0 )
    {
    header("Location: error.html");
    exit;
    }
    if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
    {
    header("Location: error.html");
    exit;
    }
    $mailto = "admin@mvtinia.com";
    $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: confirm.html");
    ?>

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

    Default Re: cant see the forest for the trees - verifying fields

    Latest information......

    name and email fields Verification are now working......thanks naval

    Contact.bvp page (action=contact.php - method=post - encoding type=blank)

    nameerror.html page - emailerror.html page - confirm.html page

    contact.php

    <?PHP
    @$name = addslashes($_POST['name']);
    @$email = addslashes($_POST['email']);
    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;
    }
    $mailto = "admin@mvtinia.com";
    $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: confirm.html");
    ?>

    ALL problems now resolved.........

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