Jump to content

yesvee

New Members
  • Posts

    8
  • Joined

  • Last visited

Posts posted by yesvee

  1. Hi

    I have a form which collects information from a user, it also has an option to upload files. I placed a recaptcha control on the form to avoid bots. However the problem is i have many fields on the form which are lost if i give a wrong captcha.

     

    I'm using hidden fields to store input values, so if user enters wrong captcha i'm restoring field values from the hidden fields, however i don't know how this can be done if the input type is file. Is it possible to store file info in the hidden field too, is yes how?

     

    at the moment it is major problem if user enters wrong code after selecting some files.

     

    Thanks for any input..

    yesvee

  2. Hi

    As i said the accountcreation.php has got very complex code and moving that into a function in the reg.php is inviting more troubles i believe.

    Can i store the data from all the 20 fields in a session and use them in accountcreation.php? but even for that i should be redirected to the second page, which is not working for me using the header(), is there any other way of doing it, like auto submit etc.. please think if you have any suggestions, It is bugging me for almost 2 days..

  3. Hi

    I'm new to php, i've been struggling for 2 days to write a simple code with recaptcha. My requirements is

    i have a registration form (reg.php) with 20 fields on it after all the required information is filled in the form data is submitted to Create Account page (CreateAccount.php).

     

    I placed a recaptcha control on the first page (reg.php) to secure the form from bots. I'm doing some javascript validation on the client side for required fields, and finally validating if correct recaptcha code is entered on the server side. That means the form is submitted to itself first for recaptcha validation, after the code is valid i want to resubmit the data to Account Creation page. i don't know how to do this. the CreateAccount.php has got a complex logic so i can not move it to the same reg.php page.

     

    i tried the following but with no luck...

     

    if ($_POST["recaptcha_response_field"]) {

    $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);

     

    if ($resp->is_valid) {

    //redirect to AccountCreation.php

    header("Location: AccountCreation.php");

     

    } else {

    $error = $resp->error;

    }

    }

     

    please help me how this is done is php. Is there any other way of doing it simply...

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.