+ Reply to Thread
Results 1 to 27 of 27

Thread: Form Script Assistance
      
   

  1. #1
    WSBlue's Avatar
    WSBlue is offline Brigadier General
    Join Date
    Apr 2006
    Posts
    1,416

    Default Form Script Assistance

    Hi ! Naval,
    Below is script (Blue) provided by you and it works.
    But when I try to apply it (Red) on another form, it doesn't work.
    Could you please take a look. Thanks
    <?php
    // Receiving variables
    @$HubNama = addslashes($_POST['HubNama']);
    @$HubAlamatJalan = addslashes($_POST['HubAlamatJalan']);
    @$HubAlamatKota = addslashes($_POST['HubAlamatKota']);
    @$HubAlamatPropinsi = addslashes($_POST['HubAlamatPropinsi']);
    @$HubAlamatKodePos = addslashes($_POST['HubAlamatKodePos']);
    @$HubTelHP = addslashes($_POST['HubTelHP']);
    @$HubEMail = addslashes($_POST['HubEMail']);
    @$HubTanyaSaran = addslashes($_POST['HubTanyaSaran']);
    // Validation
    if (strlen($HubNama) == 0 )
    {
    header("Location: error.htm");
    exit;
    }
    if (strlen($HubAlamatJalan) == 0 )
    {
    header("Location: error.htm");
    exit;
    }
    if (strlen($HubAlamatKota) == 0 )
    {
    header("Location: error.htm");
    exit;
    }
    if (strlen($HubAlamatPropinsi) == 0 )
    {
    header("Location: error.htm");
    exit;
    }
    if (strlen($HubTelHP) == 0 )
    {
    header("Location: error.htm");
    exit;
    }
    if (strlen($HubEMail) == 0 )
    {
    header("Location: error.htm");
    exit;
    }
    if (strlen($HubTanyaSaran) == 0 )
    {
    header("Location: error.htm");
    exit;
    }
    //Sending Email to form owner
    $pfw_header = "From: $HubEMail\n"
    . "Reply-To: $HubEMail\n";
    $pfw_subject = "Saran & Pertanyaan";
    $pfw_email_to = "your e mail address";
    $pfw_message = "HubNama: $HubNama\n"
    . "HubAlamatJalan: $HubAlamatJalan\n"
    . "HubAlamatKota: $HubAlamatKota\n"
    . "HubAlamatPropinsi: $HubAlamatPropinsi\n"
    . "HubAlamatKodePos: $HubAlamatKodePos\n"
    . "HubTelHP: $HubTelHP\n"
    . "HubEMail: $HubEMail\n"
    . "HubTanyaSaran: $HubTanyaSaran\n";
    *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
    header("Location: confirmation.htm");
    ?>

    --------------------------------------------------------
    --------------------------------------------------------
    Parse error: parse error in /home/httpd/vhosts/beruang.biz/httpdocs/contactus.php on line 58

    <?php
    // Receiving variables
    @$name = addslashes($_POST['name']);
    @$company = addslashes($_POST['company']);
    @$city = addslashes($_POST['city']);
    @$province = addslashes($_POST['province']);
    @$telhp = addslashes($_POST['telhp']);
    @$email = addslashes($_POST['email']);
    @$question = addslashes($_POST['question']);
    // Validation
    if (strlen($name) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($company) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($city) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($province) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($telhp) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($email) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($question) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    //Sending Email to form owner
    $pfw_header = "From: $email\n"
    . "Reply-To: $email\n";
    $pfw_subject = "Contact Us";
    $pfw_email_to = "you e mail address
    ";
    $pfw_message = "name: $name\n"
    . "company: $company\n"
    . "city: $city\n"
    . "province: $province\n"
    . "telhp: $telhp\n"
    . "email: $email\n"
    . "question: $question\n"
    *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ; 58
    header("Location: confirmation2.htm");
    ?>

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

    Default Re: Script doesn't work on another form!

    You have missed a " ; " after . "question: $question\n" ;

    Of course, delete that "58" that you have added to see which line is the line with the problem.
    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!


  3. #3
    WSBlue's Avatar
    WSBlue is offline Brigadier General
    Join Date
    Apr 2006
    Posts
    1,416

    Default Re: Script doesn't work on another form!

    Quote Originally Posted by navaldesign
    You have missed a " ; " after . "question: $question\n" ;

    Of course, delete that "58" that you have added to see which line is the line with the problem.
    Hi! Naval,
    Yes, I have corrected it.
    But why, evrytime when I open site beruang.biz/contactus.htm
    error pop up
    X A Runtime Error has occured.
    Do you wish to Debug?
    Line:297
    Error: Object expected

    if I click No, it will go to error page, when I click back to contact us, another error pop up...
    report same thing as above but ...
    Line:16
    Error:Expected identifier

    But if I click yes, it will take forever to debug.

    What shall I do? Please advise. Thank you.

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

    Default Re: Form Script Assistance

    I have tried your fom and it works ok. No error messages or anything, just the php page is extremely slow to load (can't know why). As for the rest it works 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!


  5. #5
    WSBlue's Avatar
    WSBlue is offline Brigadier General
    Join Date
    Apr 2006
    Posts
    1,416

    Default Re: Form Script Assistance

    Quote Originally Posted by navaldesign
    I have tried your fom and it works ok. No error messages or anything, just the php page is extremely slow to load (can't know why). As for the rest it works ok.
    Hi! Naval,
    I did the www.beruang.biz/contactus.htm , same as
    how I did www.beruang.biz/hubungikami.htm on BV.
    I did validation on every field but why It can't show pop up
    error message like beruang.biz/hubungikami.htm but directly
    goes to www.beruang.biz/error2.htm if error.
    Thanks for your assitance.
    PJR

  6. #6
    Andy128's Avatar
    Andy128 is offline Major General
    Join Date
    Dec 2005
    Location
    Michigan
    Posts
    2,322

    Default Re: Form Script Assistance

    Might I interject a thought-

    If you have both forms in the same directory and are using the same php script to process them- then when prompted for an error- the script is saying pull up error2.html to display the error.

    If you want a different type/design of error page- then you will have to specify that in the script. Lets say you designed an error page and name it error10.html - then would have to put that new error message page in the php script in the appropriate space.

    Hope that makes sense.

    Andy
    PHP- is a blast!

  7. #7
    WSBlue's Avatar
    WSBlue is offline Brigadier General
    Join Date
    Apr 2006
    Posts
    1,416

    Default Re: Form Script Assistance

    Quote Originally Posted by Andy128
    Might I interject a thought-

    If you have both forms in the same directory and are using the same php script to process them- then when prompted for an error- the script is saying pull up error2.html to display the error.

    If you want a different type/design of error page- then you will have to specify that in the script. Lets say you designed an error page and name it error10.html - then would have to put that new error message page in the php script in the appropriate space.
    Hope that makes sense.
    Andy
    Thanks, Andy, But where is the appropriate space in the php script?
    Or Since, the form itself can show pop up error message,
    error2.html actually will not be needed anymore, Is it right?

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

    Default Re: Form Script Assistance

    On the contary. The onform validation is needed for normal users, but they will not protect you against a spammer. So, BOTH validations are needed /as i did ib your custom form): javascript for immediate alert popup, and in the script validation for spammers and upload fields (if you intend using them), as well as radio buttons and checkboxes
    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!


  9. #9
    WSBlue's Avatar
    WSBlue is offline Brigadier General
    Join Date
    Apr 2006
    Posts
    1,416

    Default Re: Form Script Assistance

    Quote Originally Posted by navaldesign
    On the contary. The onform validation is needed for normal users, but they will not protect you against a spammer. So, BOTH validations are needed /as i did ib your custom form): javascript for immediate alert popup, and in the script validation for spammers and upload fields (if you intend using them), as well as radio buttons and checkboxes
    I don't need an upload field for this contactus form.
    I only need alert pop up error message for everyfield that is missing to be filled. How can I do it, just the one on beruang.biz/hubungikami. htm. Thanks.

  10. #10
    WSBlue's Avatar
    WSBlue is offline Brigadier General
    Join Date
    Apr 2006
    Posts
    1,416

    Default Re: Form Script Assistance

    Quote Originally Posted by Andy128
    Might I interject a thought-

    If you have both forms in the same directory and are using the same php script to process them- then when prompted for an error- the script is saying pull up error2.html to display the error.

    If you want a different type/design of error page- then you will have to specify that in the script. Lets say you designed an error page and name it error10.html - then would have to put that new error message page in the php script in the appropriate space.

    Hope that makes sense.

    Andy
    I have two different kinds of error page.
    One form doesn't show error page anymore
    because it has alert pop up error message,
    thus it will never go to error.html.

    The other form, I also want it to do the same.
    No need to go to error page,
    but it always goes to error2.html,
    which I don't want it to.
    What shall I do; shall I delete the error2.html?

  11. #11
    Andy128's Avatar
    Andy128 is offline Major General
    Join Date
    Dec 2005
    Location
    Michigan
    Posts
    2,322

    Default Re: Form Script Assistance

    It appears that you have some form validation with Javascript. The one you are describing is a php error message type. You will have to decide which one you want and then build the form accordingly. The tutorials (Forms) should show how to set up the alert type error message with the built in validation (for each form field- look at the Validate tab in the properties window).

    It is difficult to walk you through this as some coding knowledge is necessary. Perhaps using Navals DB systems and script writing service would be of benefit?

    Andy
    PHP- is a blast!

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

    Default Re: Form Script Assistance

    WS, i have set your formulir form with BOTH Javascript validation (which is great for the normally expected user errors) AND validation in the php script (i have the form processed bt ABVFP), so that no spammer can override the Javascript (easily done). If anyone overrides the Javascript validation, he gets against ABVFP's validation that will not allow him to go on.

    This is a good rule for all validations: have both Javascript (which is more immediate) and php (on script level) validation.

    You can use the built in BV validation, as Andy has suggested. However, the one i have used for your form is a modified Javascript validation, to allow for personalized messages. BV can NOT, by itself provide this detailed validation.

    If your second form always goes to the error page, it means that either you Javascript validation is wrong, so it is not activated, OR that there is a mistake in your form that the Javascript doesn't "see", but the php does, so it sends the user to the error page.
    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
    WSBlue's Avatar
    WSBlue is offline Brigadier General
    Join Date
    Apr 2006
    Posts
    1,416

    Default Re: Form Script Assistance

    Quote Originally Posted by navaldesign
    WS, i have set your formulir form with BOTH Javascript validation (which is great for the normally expected user errors) AND validation in the php script (i have the form processed bt ABVFP), so that no spammer can override the Javascript (easily done). If anyone overrides the Javascript validation, he gets against ABVFP's validation that will not allow him to go on.

    This is a good rule for all validations: have both Javascript (which is more immediate) and php (on script level) validation.

    You can use the built in BV validation, as Andy has suggested. However, the one i have used for your form is a modified Javascript validation, to allow for personalized messages. BV can NOT, by itself provide this detailed validation.

    If your second form always goes to the error page, it means that either you Javascript validation is wrong, so it is not activated, OR that there is a mistake in your form that the Javascript doesn't "see", but the php does, so it sends the user to the error page.
    LOL! I thought I got it but NO!
    I opened with Notepad and went through page www.beruang.biz/contactus.htm and found out all Editboxes (1,2,3... ...) were left empty so I named them one by one; Editbox1,2,3... and TextArea1, just like www.beruang.biz/hubungikami.htm
    But form contactus still can't show pop up error mesaage but connect to contactus.php then show up error2.htm
    And I also found out this additional script
    <STYLE type=text/css>IMG {
    BEHABIOUR:url("pngfix.***")
    }
    at hubungikami that didn't show at contactus, so I inserted them at the same position shown in hubungikami at contactus page.
    But I fail, I can make it like what Naval did.
    Naval, can you please help to see what went wrong in it ? Thank you.

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

    Default Re: Form Script Assistance

    The form has to be built from scratch. If this is the original form you had, built in BV8 the validation will probably not work.
    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!


  15. #15
    WSBlue's Avatar
    WSBlue is offline Brigadier General
    Join Date
    Apr 2006
    Posts
    1,416

    Default Re: Form Script Assistance

    Quote Originally Posted by navaldesign View Post
    The form has to be built from scratch. If this is the original form you had, built in BV8 the validation will probably not work.
    Hi! Naval,
    I have managed to show pop up error message when every field is missing or incorrect. BUT even after every field is filled and correct, it still goes to error page. Could you please check it out, where goes wrong?
    www.beruang.biz/contactus.htm

    I compare it with www.beruang.biz/hubungikami.htm .
    I can't find their php script has any differences.
    But this one can always go to thank you page.
    Thanks a lot.

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

    Default Re: Form Script Assistance

    Probably your script is looking for some field that doesn't exist. I can't know, because the php code is not visible.
    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!


  17. #17
    WSBlue's Avatar
    WSBlue is offline Brigadier General
    Join Date
    Apr 2006
    Posts
    1,416

    Default Re: Form Script Assistance

    Quote Originally Posted by navaldesign View Post
    Probably your script is looking for some field that doesn't exist. I can't know, because the php code is not visible.
    <?php
    // Receiving variables
    @$name = addslashes($_POST['Name']);
    @$company = addslashes($_POST['Street']);
    @$city = addslashes($_POST['City']);
    @$province = addslashes($_POST['Province']);
    @$telhp = addslashes($_POST['TelHP']);
    @$email = addslashes($_POST['EMail']);
    @$question = addslashes($_POST['Message']);
    // Validation
    if (strlen($Name) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($Street) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($City) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($Province) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($TelHP) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($EMail) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($Message) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    //Sending Email to form owner
    $pfw_header = "From: $email\n"
    . "Reply-To: $email\n";
    $pfw_subject = "Contact Us";
    $pfw_email_to = "xxxxx@xxxxx. com";
    $pfw_message = "Name: $Name\n"
    . "Street: $Street\n"
    . "city: $city\n"
    . "Province: $Province\n"
    . "Tel HP: $TelHP\n"
    . "E Mail: $EMail\n"
    . "Message: $Message\n";
    *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
    header("Location: confirmation2.htm");
    ?>

  18. #18
    Andy128's Avatar
    Andy128 is offline Major General
    Join Date
    Dec 2005
    Location
    Michigan
    Posts
    2,322

    Default Re: Form Script Assistance

    Ok-

    None of your variables match your form fields. This script will not work with that form.

    Go back to the drawing board- start over. Build if from scratch as Naval suggested. Make sure he variables, form fields and php script all match up. It is case sensitive. Therefore Name and name are two different things as far as the script is concerned.

    Andy
    PHP- is a blast!

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

    Default Re: Form Script Assistance

    Could not have explained it better.
    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!


  20. #20
    WSBlue's Avatar
    WSBlue is offline Brigadier General
    Join Date
    Apr 2006
    Posts
    1,416

    Default Re: Form Script Assistance

    I have corrected and check and recheck but still goes to error page.
    Could you please tell me, what still goes wrong? Thank you.

    <?php
    // Receiving variables
    @$Name = addslashes($_POST['Name']);
    @$Street = addslashes($_POST['Street']);
    @$City = addslashes($_POST['City']);
    @$Province = addslashes($_POST['Province']);
    @$TelHP = addslashes($_POST['TelHP']);
    @$EMail = addslashes($_POST['EMail']);
    @$Message = addslashes($_POST['Message']);
    // Validation
    if (strlen($Name) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($Street) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($City) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($Province) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($TelHP) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($EMail) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($Message) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    //Sending Email to form owner
    $pfw_header = "From: $EMail\n"
    . "Reply-To: $EMail\n";
    $pfw_subject = "Contact Us";
    $pfw_email_to = "xxxx@xxx.kom";
    $pfw_message = "Name: $Name\n"
    . "Street: $Street\n"
    . "City: $City\n"
    . "Province: $Province\n"
    . "TelHP: $TelHP\n"
    . "EMail: $EMail\n"
    . "Message: $Message\n";
    *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
    header("Location: confirmation2.htm");
    ?>

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

    Default Re: Form Script Assistance

    You have not checked correctly:

    the email field is "E Mail" in the form, "Email" in the script.
    The Telephone is "Tel HP" in the form, "TelHP" in the script.
    "Post Code": it exists in the form, but not in the script.

    ALL variables should be the same between form and script. Copy the script from here:


    <?php
    // Receiving variables
    @$Name = addslashes($_POST['Name']);
    @$Street = addslashes($_POST['Street']);
    @$City = addslashes($_POST['City']);
    @$Province = addslashes($_POST['Province']);
    @$PostCode = addslashes($_POST['Post Code']);
    @$TelHP = addslashes($_POST['Tel HP']);
    @$EMail = addslashes($_POST['E Mail']);
    @$Message = addslashes($_POST['Message']);
    // Validation
    if (strlen($Name) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($Street) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($City) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($Province) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($TelHP) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($EMail) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($Message) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    //Sending Email to form owner
    $pfw_header = "From: $EMail\n"
    . "Reply-To: $EMail\n";
    $pfw_subject = "Contact Us";
    $pfw_email_to = "xxxx@xxx.kom";
    $pfw_message = "Name: $Name\n"
    . "Street: $Street\n"
    . "City: $City\n"
    . "Province: $Province\n"
    . "Post Code: $PostCode\n"
    . "Tel HP: $TelHP\n"
    . "Email: $EMail\n"
    . "Message: $Message\n";
    *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
    header("Location: confirmation2.htm");
    ?>
    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!


  22. #22
    WSBlue's Avatar
    WSBlue is offline Brigadier General
    Join Date
    Apr 2006
    Posts
    1,416

    Default Re: Form Script Assistance

    Quote Originally Posted by navaldesign View Post
    You have not checked correctly:

    the email field is "E Mail" in the form, "Email" in the script.
    The Telephone is "Tel HP" in the form, "TelHP" in the script.
    "Post Code": it exists in the form, but not in the script.

    ALL variables should be the same between form and script. Copy the script from here:


    <?php
    // Receiving variables
    @$Name = addslashes($_POST['Name']);
    @$Street = addslashes($_POST['Street']);
    @$City = addslashes($_POST['City']);
    @$Province = addslashes($_POST['Province']);
    @$PostCode = addslashes($_POST['Post Code']);
    @$TelHP = addslashes($_POST['Tel HP']);
    @$EMail = addslashes($_POST['E Mail']);
    @$Message = addslashes($_POST['Message']);
    // Validation
    if (strlen($Name) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($Street) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($City) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($Province) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($TelHP) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($EMail) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($Message) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    //Sending Email to form owner
    $pfw_header = "From: $EMail\n"
    . "Reply-To: $EMail\n";
    $pfw_subject = "Contact Us";
    $pfw_email_to = "xxxx@xxx.kom";
    $pfw_message = "Name: $Name\n"
    . "Street: $Street\n"
    . "City: $City\n"
    . "Province: $Province\n"
    . "Post Code: $PostCode
    . "Tel HP: $TelHP\n"
    . "Email: $EMail\n"
    . "Message: $Message\n";
    *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
    header("Location: confirmation2.htm");
    ?>
    I copied your script above, but received report:
    Parse error: parse error in /home/httpd/vhosts/beruang.biz/httpdocs/contactus.php on line 57
    I tried to correct it but still not ok.
    . "Tel HP: $TelHP\n"
    (any different has space in between)
    I used EMail and TelHP in the form and also the script.

    Did I do any wrong again. Please help. Thank you.

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

    Default Re: Form Script Assistance

    Sorry, my mistake, i have edited it. Copy again the script and repeat the procedure.
    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!


  24. #24
    WSBlue's Avatar
    WSBlue is offline Brigadier General
    Join Date
    Apr 2006
    Posts
    1,416

    Default Re: Form Script Assistance

    Quote Originally Posted by navaldesign View Post
    Sorry, my mistake, i have edited it. Copy again the script and repeat the procedure.
    Hi! Naval,
    I'm sorry to keep bothering you.
    I have tried both scripts below ( One with blue text, was the first one, you provided. And the other with red text, was the one when I replied).
    But both still go to error page even after all fields had been filled.
    I rechecked and rechecked but still not good enough, could make it work/ go to confirmation2.
    You said; you had edited it. Please advise again, which one you edited Blue or Red? Thank you.

    <?php
    // Receiving variables
    @$Name = addslashes($_POST['Name']);
    @$Street = addslashes($_POST['Street']);
    @$City = addslashes($_POST['City']);
    @$Province = addslashes($_POST['Province']);
    @$PostCode = addslashes($_POST['Post Code']);
    @$TelHP = addslashes($_POST['Tel HP']);
    @$EMail = addslashes($_POST['E Mail']);
    @$Message = addslashes($_POST['Message']);
    // Validation
    if (strlen($Name) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($Street) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($City) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($Province) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($TelHP) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($EMail) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($Message) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    //Sending Email to form owner
    $pfw_header = "From: $EMail\n"
    . "Reply-To: $EMail\n";
    $pfw_subject = "Contact Us";
    $pfw_email_to = "
    xxxx@xxx.kom";
    $pfw_message = "Name: $Name\n"
    . "Street: $Street\n"
    . "City: $City\n"
    . "Province: $Province\n"
    . "Post Code: $PostCode\n"
    . "Tel HP: $TelHP\n"
    . "Email: $EMail\n"
    . "Message: $Message\n";
    *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
    header("Location: confirmation2.htm");
    ?>


    <?php
    // Receiving variables
    @$Name = addslashes($_POST['Name']);
    @$Street = addslashes($_POST['Street']);
    @$City = addslashes($_POST['City']);
    @$Province = addslashes($_POST['Province']);
    @$PostCode = addslashes($_POST['Post Code']);
    @$TelHP = addslashes($_POST['Tel HP']);
    @$EMail = addslashes($_POST['E Mail']);
    @$Message = addslashes($_POST['Message']);
    // Validation
    if (strlen($Name) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($Street) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($City) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($Province) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($TelHP) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($EMail) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($Message) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    //Sending Email to form owner
    $pfw_header = "From: $EMail\n"
    . "Reply-To: $EMail\n";
    $pfw_subject = "Contact Us";
    $pfw_email_to = "
    xxxx@xxx.kom";
    $pfw_message = "Name: $Name\n"
    . "Street: $Street\n"
    . "City: $City\n"
    . "Province: $Province\n"
    . "Post Code: $PostCode
    . "Tel HP: $TelHP\n"
    . "Email: $EMail\n"
    . "Message: $Message\n";
    *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
    header("Location: confirmation2.htm");
    ?>

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

    Default Re: Form Script Assistance

    The blue one is the correct one.
    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!


  26. #26
    WSBlue's Avatar
    WSBlue is offline Brigadier General
    Join Date
    Apr 2006
    Posts
    1,416

    Default Re: Form Script Assistance

    Quote Originally Posted by navaldesign View Post
    The blue one is the correct one.
    <?php
    // Receiving variables
    @$Name = addslashes($_POST['Name']);
    @$Street = addslashes($_POST['Street']);
    @$City = addslashes($_POST['City']);
    @$Province = addslashes($_POST['Province']);
    @$PostCode = addslashes($_POST['Post Code']);
    @$TelHP = addslashes($_POST['Tel HP']);
    @$EMail = addslashes($_POST['E Mail']);
    @$Message = addslashes($_POST['Message']);
    // Validation
    if (strlen($Name) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($Street) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($City) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($Province) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }

    if (strlen($TelHP) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($EMail) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    if (strlen($Message) == 0 )
    {
    header("Location: error2.htm");
    exit;
    }
    //Sending Email to form owner
    $pfw_header = "From: $EMail\n"
    . "Reply-To: $EMail\n";
    $pfw_subject = "Contact Us";
    $pfw_email_to = "xxxx@xxx.kom";
    $pfw_message = "Name: $Name\n"
    . "Street: $Street\n"
    . "City: $City\n"
    . "Province: $Province\n"
    . "Post Code: $PostCode\n"
    . "Tel HP: $TelHP\n"
    . "Email: $EMail\n"
    . "Message: $Message\n";
    *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
    header("Location: confirmation2.htm");
    ?>


    Yes, I got it . Thank you Naval,
    I finally can get it to confirmation page.
    I redo the form and go over scipt.

    I couldn't get the Blue one work.
    Please check green text.
    Receiving variables and Sending e mail to form owner.
    TelHP (no space )and Tel HP (space).
    Tel HP (space) and TelHP (no space).
    Email and EMail
    Because of these irregular scripts causes the problem?
    Please advise.

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

    Default Re: Form Script Assistance

    Don't confuse "Tel HP:" which is simply the text that you will recieve in the email, with the "$TelHP" which is the local variable assigned for the telephone, nor with the "($_POST['Tel HP']);" which is the post variable as recieved from the form. The script is correct, otherwise you would nor receive neither the email address or the telephone, and the script would go to the error page.
    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