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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:42:07+00:00 2026-06-08T12:42:07+00:00

A typical browser based user visits site (A), then links to some sub page

  • 0

A typical browser based user visits site (A), then links to some sub page (B), then another (C), and lastly reviews their activity on page (D)

I’m trying to simulate these first steps via curl so that upon firing my script, it interacts with the target domain, and the user ends up on (D) without needing to take the intermediary actions.

I don’t have much experience with curl, and I have a feeling that I’m botching something at the end when I go to that final page (cookies that I’d explicitly set are overwritten, etc). I also remain on the URL of my script rather than really being on that other site…but if I use a Location header, I’m even more certainly ignoring the prior actions.

What I get from the below is I end up on (D) with no recognition of having previously hit (A)(B)(C)

This is the code I’ve been trying to work with, but I’m not sure whether I’m missing some CURLOPT, or if it’s something more fundamental in my approach. Thanks for any guidance.

<?php
$item1=990525;
$item2=208208;
$home="http://www.somedomain.com";
$add=$home."/cart/addSkuByButton.do;jsessionid=0000RSqxtdShvtVm0lVAb29p-9N:1659q38ci?ajaxATCRequest=true&sourcePage=&cmd_addCart.button.INDEX[0]=Add%20to%20Cart&trackingCategory=1000000000&entryFormList[0].selected=on&entryFormList[0].sku=";
$toCart="&entryFormList[0].qty=";
$cart=$home."/cart/shoppingCart.do;jsessionid=0000RSqxtdShvtVm0lVAb29p-9N:1659q38ci";

session_start(); //do I need this?
//setup
$c=curl_init();
curl_setopt($c,CURLOPT_RETURNTRANSFER,true);
curl_setopt($c,CURLOPT_COOKIESESSION,true); //should I use this? I've also tried COOKIEFILE without success
curl_setopt($c,CURLOPT_FOLLOWLOCATION, true);
curl_setopt($c,CURLOPT_HEADER, 1);

//set a session ID
curl_setopt($c,CURLOPT_COOKIE, "jsessionid=0000RSqxtdShvtVm0lVAb29p-9N:1659q38ci; path=/; domain=www.somedomain.com");

//visit main domain
curl_setopt($c,CURLOPT_URL, $home);
curl_exec($c);

//programattically visit sub pages
curl_setopt($c,CURLOPT_URL, $add.$item1.$toCart);
curl_exec($c);
curl_setopt($c,CURLOPT_URL, $add.$item2.$toCart);
curl_exec($c);
curl_setopt($c, CURLOPT_RETURNTRANSFER, false);
curl_setopt($c,CURLOPT_HEADER, false);

//actually visit final page
curl_setopt($c,CURLOPT_URL, $cart);
curl_exec($c);
curl_close($c);
?>
  • 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-08T12:42:08+00:00Added an answer on June 8, 2026 at 12:42 pm

    curl won’t execute any javascript, which I am guessing is your problem. When a browser based user visits a site, the javascript is executed by the browsers javascript interpreter. curl will simply return the plain text source code.

    Does the curl library execute javascript inside pages?

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

Sidebar

Related Questions

What are some guidelines for displaying information to a user in a web-browser? I
I have a typical ADO.NET EF-driven form that allows the user to input a
I have yer typical servlet that streams a pdf to a browser. The pdfs
I am using a flash module for site navigation (Freemind flash browser). However, I'm
Try open the following page in two different tabs in your browser. hit the
According to this post a typical firefox user has 2-3 tabs open. How can
I want to develop one application where it will automatically (based on some logic)
I'm using some of the typical ASP.NET's Validation Controls in my website. Now I'm
I am looking for a web based subversion browser and checkout/update/commit tool. The repository
Our web site makes use of showModalDialog . Based on what is done within

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.