Jump to content

yesvee

New Members
  • Posts

    8
  • Joined

  • Last visited

yesvee's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. do i have any options other than showing a warning message to user to upload the files again...
  2. 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
  3. or shall use javascript to validate a captcha field, that seems much simpler
  4. I think i should go by your idea of moving the AccountCreation code into reg.php, as i found a file field for file attachements by the user. so i have a feeling that transfering all the data along with the file attachemnts is beyond by calibre now so i'll try to move the code back to the first page...it is a tough task but doable. php is not easy as many people say
  5. 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..
  6. Thanks for the reply, i tried the above code but it is not working, it stays on the same page reg.php after successful validation. Also on sending variables is it possible to use post method as i have 20 fields and some of them are text area fields.
  7. 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.