Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6641481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:48:58+00:00 2026-05-25T23:48:58+00:00

I have an HTML form, being submitted to a PHP page. The PHP page

  • 0

I have an HTML form, being submitted to a PHP page. The PHP page needs to validate a captcha and then pass the form values to a JSP page. I have NO control over the JSP page. Captcha is working beautifully. Something is getting lost in my PHP page, as when it loads the information on the JSP page, the CSS and headers of the target page aren’t loading and the form data isn’t being passed. I do not have access to the JSP page. Any ideas?

BTW, Captcha validation is working fine and the HTML works fine if I pass it directly to the JSP page:

 <?php
  require_once('recaptchalib.php');
  $privatekey = "privatekeyhere";
  $resp = recaptcha_check_answer ($privatekey,
                                $_SERVER["REMOTE_ADDR"],
                                $_POST["recaptcha_challenge_field"],
                                $_POST["recaptcha_response_field"]);

  if (!$resp->is_valid) {
    // What happens when the CAPTCHA was entered incorrectly
    die ("<p align='center'>The reCAPTCHA wasn't entered correctly. Please go back and try it again." .
         "(reCAPTCHA said: " . $resp->error . ")</p>");
  } else {


  $ipaddress = $_SERVER["REMOTE_ADDR"];
  $fname = $_POST['fname'];
  $address = $_POST['address'];
  $city = $_POST['city'];
  $state = $_POST['state'];
  $zip = $_POST['zip'];
  $phone = $_POST['phone'];
  $email = $_POST['email'];


  $h = curl_init();
  curl_setopt($h, CURLOPT_URL, "//remote JSP page"); 
  curl_setopt($h, CURLOPT_HEADER, true);
   curl_setopt($h, CURLOPT_POST, true);
  curl_setopt($h, CURLOPT_POSTFIELDS, array(

  'fname' => '$fname',
  'address' => '$address',
  'city' => '$city',
  'state' => '$state',
  'zip' => '$zip',
  'phone' => '$phone',
  'email' => '$email',
  ));
  curl_setopt($h, CURLOPT_RETURNTRANSFER, 1);

  $result = curl_exec($h);
  echo $result;


      }
  ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:48:59+00:00Added an answer on May 25, 2026 at 11:48 pm

    Problems I can spot right away:

    1. CURLOPT_POSTFIELD has to be a POST string, not an array.
    2. Even then, you’re posting strings representing variable names (you should post the value instead.

    For point 1, here’s a simple cUrl tutorial by David Walsh, covering a case very similar to yours and containing a way to transform arrays in POST strings: http://davidwalsh.name/execute-http-post-php-curl

    For point 2, strings inside 'single quotes' are not evaluated. To refer to a variable, you should use $var, not '$var'.

    Bonus: anything in a POST/GET string should be urlencoded.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an HTML form - with PHP, I am sending the data of
I have an HTML form where I am going to copy values from a
I have a HTML form that is sometimes submitted with accented characters: à, è,
I'm having problems binding on a form with multiple models being submitted. I have
I have a checkbox, but the form is being submitted the value ticked are
I have a form on a page that requires a captcha if the user
I have a form that is submitted to a php script with jquery and
I have a following problem, I have HTML form that uploads a file with
My input tag started to go crazy... I have html form for input to
I have a HTML form, and I have a Controller Action that accepts the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.