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 8318391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:57:16+00:00 2026-06-08T21:57:16+00:00

I am trying to curl post with php The page I am trying to

  • 0

I am trying to curl post with php
The page I am trying to submit has codes like this

<input name="fname" type="hidden" value="show">
<input name="method" type="submit" value="Continue">

I am trying to simulate this “sumbit”(continue) button and follow redirection with php

$post= array("method=>Continue")

$ch = curl_init();
 curl_setopt($ch, CURLOPT_URL, $string);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp/cookies.txt');
 curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt');
 curl_setopt ($ch, CURLOPT_POST, 1);
 curl_setopt ($ch, CURLOPT_POSTFIELDS, $post);
 curl_setopt($ch, CURLOPT_FOLLOWLOCATION  ,1);
 $h = curl_exec($ch);
echo $h;

What should I have in the $post= array(?).
I have tried $post= array(name => method). Not working..any ideas?

  • 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-08T21:57:20+00:00Added an answer on June 8, 2026 at 9:57 pm

    You can set the CURLOPT_POSTFIELDS option to the array itself:

    $post = array(
        "method" => "Continue",
        "fname" => "show"
    );
    
    curl_setopt ($ch, CURLOPT_POSTFIELDS, $post);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: cURL: Just trying to download a page I'm trying to submit this
I'm trying to convert the following CURL: curl -X POST \ -H Content-Type: image/jpeg
I'm trying to use Curl in PHP to read a unreliable web page. The
I found this example PHP source code at HTTP POST from PHP, without cURL
I am trying to post to my facebook page wall using curl but i
I am trying to post to a REST service using PHP cURL but I'm
From a PHP page, I'm trying to POST some data to another PHP page
I have a small problem with php curl post. I am trying to post
i'm trying to make post to an external url using curl, the externa page
I'm trying to post to WordPress using curl via PHP - I'm posting using

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.