+ Reply to Thread
Results 1 to 14 of 14

Thread: help for validating forms
      
   

  1. #1
    chandni is offline Second Lieutenant
    Join Date
    Mar 2006
    Posts
    114

    Default help for validating forms

    hello there i have this form the link is the fields marked in this form with an * name, second name are mandatory fields. i have created a form i.e. the second link which should be called when any of the mandatory fields is left blank. the second page which i have created says hit the back button of your browers and fill in the name. please help me with the script so that when i click on the submit button the form should check if the mandatory fields are not left empty. secondly, i have a doubt. i have two fields which are mandatory. do i have to create two seperate pages one to validate name and second to validate the second name. or just one form can do the work.

    http://www.leximindia.com/info.html

    http://www.leximindia.com/infovalidation.html

    many thanks
    chandni

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

    Default Re: help for validating forms

    Hi chandni:
    Your http://www.leximindia.com/infovalidation.html
    form is perfect.

    copy your existing php form here and someone will take a look and advise you. (put xxxx@xxxx.com in your email address before you post the php)

  3. #3
    chandni is offline Second Lieutenant
    Join Date
    Mar 2006
    Posts
    114

    Default Re: help for validating forms

    thanks for you reply but i am confused.. where do i take the php from...
    many thanks
    chandni

  4. #4
    nick1346 is offline Major
    Join Date
    Jan 2006
    Posts
    317

    Default Re: help for validating forms

    Hi There,

    You can find the php file in your public html folder in your ftp manager. To get that open blue voda, click on tools, ftp manger,go into your public html folder and you'll find it there as contactus1.php, save that to your hard drive then cut and paste that into a post here.
    Nick

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

    Default Re: help for validating forms

    If i understand well, chandni has not yet created and uploaded a php script. He's asking for one, i'm i correct?
    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!


  6. #6
    chandni is offline Second Lieutenant
    Join Date
    Mar 2006
    Posts
    114

    Default Re: help for validating forms

    yes navaldesign, the php script to validate is what i requested for. can u please help me with the php script. and where should i add this php script.

    thanks
    chandni

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

    Default Re: help for validating forms

    Ok, i'll preapare a script for you. When i'll have it ready, you must upload it to your site using BlueFTP. I'll post back for you.
    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
    chandni is offline Second Lieutenant
    Join Date
    Mar 2006
    Posts
    114

    Default Re: help for validating forms

    i shall wait for ur script, many thanks navaldesign u have been very helpful

    chandni

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

    Default Re: help for validating forms

    Sorry, just found out that your fields are not named correctly. They are named T1, T2 etc. Please give your fields real names, like "Name", Surname" etc. and then republish and let me know
    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
    chandni is offline Second Lieutenant
    Join Date
    Mar 2006
    Posts
    114

    Default Re: help for validating forms

    i am sorry about that navaldesign i have republised the page with real names...
    many thanks
    chandni

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

    Default Re: help for validating forms

    Ok, i'll let you know
    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!


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

    Default Re: help for validating forms

    Hi,

    here it goes:

    <?php
    // Receiving variables
    @$Tittle = addslashes($_POST['Tittle']);
    @$Name = addslashes($_POST['Name']);
    @$Surname = addslashes($_POST['Surname']);
    @$Companyname = addslashes($_POST['Companyname']);
    @$Address1 = addslashes($_POST['Address1']);
    @$state = addslashes($_POST['state']);
    @$Address2 = addslashes($_POST['Address2']);
    @$City = addslashes($_POST['City']);
    @$country = addslashes($_POST['country']);
    @$pin = addslashes($_POST['pin']);
    @$email = addslashes($_POST['email']);
    @$telephone = addslashes($_POST['telephone']);
    // Validation
    if (strlen($Name) == 0 )
    {
    header("Location: infovalidation.html");
    exit;
    }
    if (strlen($Surname) == 0 )
    {
    header("Location: infovalidation.html");
    exit;
    }
    if (strlen($Companyname) == 0 )
    {
    header("Location: infovalidation.html");
    exit;
    }
    if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
    {
    header("Location: infovalidation.html");
    exit;
    }
    if (strlen($email) == 0 )
    {
    header("Location: infovalidation.html");
    exit;
    }
    if (strlen($telephone) == 0 )
    {
    header("Location: infovalidation.html");
    exit;
    }
    // Find Server date and Time
    $date = date("l jS F Y, g:i A");
    // Find Browser and IPaddress
    $browser =$_SERVER['HTTP_USER_AGENT'];
    $ip = $_SERVER['REMOTE_ADDR'];

    //Sending Email to form owner
    $pfw_header = "From: $email\n"
    . "Reply-To: $email\n";
    $pfw_subject = "Info Submited by our Web Information Request Form";
    $pfw_email_to = "youremail@leximindia.com";

    $pfw_message = "----------------------------------------------------\n"
    . "Tittle: $Tittle\n"
    . "Name: $Name\n"
    . "Surname: $Surname\n"
    . "Companyname: $Companyname\n"
    . "Address1: $Address1\n"
    . "Address2: $Address2\n"
    . "City: $City\n"
    . "state: $state\n"
    . "country: $country\n"
    . "pin: $pin\n"
    . "email: $email\n"
    . "telephone: $telephone\n"
    . "----------------------------------------------------\n"
    . "Received on : $date\n"
    . "Browser : $browser\n"
    . "IP address : $ip\n"
    . "----------------------------------------------------\n";
    *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
    header("Location: thankyou_page.html");
    ?>


    1. Copy the code and paste it in Notepad. Change the email adress to be your own email address in your Vodahost account.
    2. Create a "thankyou" page in BV. Save it as "thankyou_page". Publish it.
    3. Go to "Save as", choose "File type", select "All files", and save it as "contactus1.php". Upload it on the server using Blue FTP. DO NOT PASTE IT IN ANY BV PAGE.
    4. If in the future you need to create different error pages for every error, just change this line:
    header("Location: infovalidation.html");
    after every field validation.
    5. You may want to avoid your visitors having to press the browser "Back" button. You can insert a "Back button" directly in your "infovalidation" page by either inserting an Advanced Button (BV,>Insert>Form>Advanced Button, make it "On click", give it action "Go to the previous Page", OR you can insert an HTML box in your page, and paste in it the following code:
    <FORM>
    <input type="button" class="but" value="< BACK TO THE FORM " onclick=history.go(-1)>
    </FORM>

    Let me know if everything has worked out ok.
    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!


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

    Default Re: help for validating forms

    Forgot: change the encoding of your form in "multipart / form data" save it and republish it.
    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!


  14. #14
    chandni is offline Second Lieutenant
    Join Date
    Mar 2006
    Posts
    114

    Thumbs up Re: help for validating forms

    ur a genuis navaldesign thank you so much.....
    regards
    chandni

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