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

  • Home
  • SEARCH
  • 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 8798325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:04:17+00:00 2026-06-14T00:04:17+00:00

I have a simple php curl function that goes to another site(not owned by

  • 0

I have a simple php curl function that goes to another site(not owned by me) and fills in the fields and works properly the only thing is i cant get it to check a check box. i cant seem to find an answer.

curl_setopt($ch, CURLOPT_HEADER, false);

curl_setopt($ch, CURLOPT_NOBODY, false); 
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 

curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path); 
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path); 

curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7"); 

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); 
curl_setopt($ch, CURLOPT_POST, 1); 
$searchCriteria = array(
      'historicalMatches' => $_POST['historicalMatches'],  //the checkbox
      'firstName'  => $_POST['firstName'], 
      'middleName' => $_POST['middleName'],
      'lastName'   => $_POST['lastName'], 
      'suffix'     => $_POST['suffix'],
      'age'        => $_POST['age'],
      etc..);

curl_setopt($ch, CURLOPT_POSTFIELDS, $searchCriteria);  

i have tried setting the value to 1 and on and checked. The html for the checkbox on the other page is:

<input type="checkbox" name="historicalMatches" value="on">

all i need to do is make sure it is checked everytime. So i can add a 2nd

curl_setopt($ch, CURLOPT_POSTFIELDS, 'check the box');

that just clicks the box I just cant figure it out. Thanks

  • 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-06-14T00:04:18+00:00Added an answer on June 14, 2026 at 12:04 am

    I don’t see where $_POST['historicalMatches'] is coming from, but that is likely the problem.

    Adding:

    'historicalMatches' => 'on'
    

    to your array of $searchCriteria should be the proper way to emulate the checkbox being checked. Simply omitting that value from the postfields would indicate the box was unchecked.

    Since the checkbox’s value is on, just post that value with the checkbox name when you want the checkbox checked, or leave it out of the parameters to have it unchecked.

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

Sidebar

Related Questions

I have a simple cURL script that works just fine. But I'm curious about
I have simple php validation form that is halfway working. If you leave the
I have a simple php script on my domain that sends me an email:
I have a simple PHP app that prints 'hello world'. When I run it
I have a simple PHP script that will either serve up a streaming ASF
I have a simple php page that displays data from a mysql database. I
I have a simple class that I've added to the components folder called mixpanel.php.
I already have a function on my page that produces url from curl. I
I have a simple PHP program that list some topics. for example I have
I have a site that has a simple API which can be used via

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.