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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:14:29+00:00 2026-05-23T23:14:29+00:00

this is what I’m trying to do: pass a form with a curl statement

  • 0

this is what I’m trying to do:

  • pass a form with a curl statement using POST variable => good
  • after i’m logged in the website go to whichever page I want => not good

here is my script for now:

$postData = array(
    'login' => 'john',
    'pwd' => 'doe'
);

$array_url = array('3109');

foreach ($array_url as $k => $i) {
    echo $i."<br>";
    $c = curl_init();

    $url = "http://mywebsite/index.php?ok=1";

    curl_setopt($c, CURLOPT_URL, $url);
    curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($c, CURLOPT_FOLLOWLOCATION, TRUE);
    curl_setopt($c, CURLOPT_POSTFIELDS, $postData);

    $output = curl_exec($c);
    if ($output === false) {
        trigger_error('Erreur curl : ' . curl_error($c), E_USER_WARNING);
    }
    else {

        var_dump($output);
        echo $output;
    }
    curl_close($c);
}

How can I achieve this ?

edit: If I try to fetch the page I would like to consult I get redirect to the login form cause I can’t set the couple login/pass from this page, I need to fetch the checkingpassword one…

Thx

  • 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-23T23:14:29+00:00Added an answer on May 23, 2026 at 11:14 pm

    You need to determine how the remote page is authenticating sessions. Most sites do this using a cookie. Once you’ve logged in, any consecutive page requests pass the cookie, the remote site checks the cookie, if it is valid and not expired, it lets you through, otherwise, it kicks you back to the login page (or gives you an error, or whatever).

    So if it’s a cookie, you need to store the cookie that’s returned, and use that in any subsequent curl requests.

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

Sidebar

Related Questions

This is my first post here and I wanted to get some input from
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This is my first time using Magento. I upgraded this site from 1.4.1.1 to
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
This is an example of the code am using. I use a modified version
This is my first time creating a PHP form that will run a MySQL
This question is quite specific. I'm using Symfony2 White October Admin Bundle for generating
This is a bit of a long shot, but if anyone can figure it
This is starting to vex me. I recently decided to clear out my FTP,

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.