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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:22:55+00:00 2026-05-18T10:22:55+00:00

HI, I am able to login into the site using php and curl. but

  • 0

HI,

I am able to login into the site using php and curl. but when i try to read the data after logging in it shows string(0) “” if CURLOPT_RETURNTRANSFER enabled and when disabled it shows bool(true). I dont understand where exactly i am going wrong…

any help is really appreciated

heres code

$cookie_file_path = "C:\\Apache2\\htdocs\\test.txt";


//$fp = fopen($cookie_file_path,'wb');   
//fclose($fp);

$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/3.6.0";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://kinray.com/redirector1/weblink.jsp");   
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_fie_path);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
curl_setopt($ch, CURLOPT_REFERER, "http://www.google.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//Do not print anything now. 
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, "custId=XXXXX&passWord=YYYYY");

$html = curl_exec($ch);
var_dump(urlencode($html));

 curl_close();
 $ch1 = curl_init();

   curl_setopt($ch1, CURLOPT_URL,"https://kinray.com/weblink2/search/categories.do?scrollType=&code=&alwaysCustomerNumber=023987");   
   curl_setopt($ch1, CURLOPT_COOKIEFILE, $cookie_fie_path);
   curl_setopt($ch1, CURLOPT_COOKIEJAR, $cookie_file_path);
   curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1);
   curl_setopt($ch1,CURLOPT_HTTPGET,true);
   //curl_setopt($ch1, CURLOPT_FOLLOWLOCATION, 1);
   //curl_setopt($ch1, CURLOPT_HEADER, 1);
   curl_setopt($ch1, CURLOPT_SSL_VERIFYPEER, 0);
   curl_setopt($ch1, CURLOPT_SSL_VERIFYHOST, 0);
   $html2 = curl_exec($ch1);
   curl_close();
   echo "<hr>";
   var_dump( $html2);

Any clue where am i going wrong?

  • 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-18T10:22:55+00:00Added an answer on May 18, 2026 at 10:22 am

    should these variables be different?

    //                                              v
    curl_setopt($ch1, CURLOPT_COOKIEFILE, $cookie_fie_path);
    curl_setopt($ch1, CURLOPT_COOKIEJAR,  $cookie_file_path);
    //                                              ^
    

    It may be that your cookies aren’t being stored/retrieved properly.

    httpRequest Class Example (short form static constructors):

    $loginAttempt = httpRequest::post(
            'https://kinray.com/redirector1/weblink.jsp',
            'custId=XXXXX&passWord=YYYYY'
        )
        ->ignoreSSL()
        ->setCookieJar($cookie_file_path)
        ->retrieveHeader()
        ->setManualOption(CURLOPT_REFERER, "http://www.google.com")
        ->splode(); // executes the request
    // you can get to the returned value with $loginAttempt->responseRaw,
    // or a host of other options, see __get()
    
    $loggedInPage = httpRequest::get('https://kinray.com/weblink2/search/categories.do?scrollType=&code=&alwaysCustomerNumber=023987')
        ->ignoreSSL()
        ->setCookieJar($cookie_file_path)
        ->splode();
    

    you can easily get to the response body by accessing the body property ($loggedInPage->body, for example) from there. Let me know if this works for you.

    EDIT: Sample Response

    <script>document.oncontextmenu = function(){return false;};</script>
    <!--categories.jsp-->
    <html>
    <head>
    <title></title>
    <LINK rel=stylesheet type=text/css href="/weblink2/styles.css">
    <script>
       
       
       
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    top.frames.search.setPaging('up'  , true);
    top.frames.search.setPaging('down', true);
    
    
       var categories  = [ 
       
       ["27","BABY DIAPERS                                      "],
       
       ["28","BABY FORMULA                                      "],
       
       ["66","BAG STUFFER (PG)                                  "],
       
       ["90","BAG STUFFER FLYER DECEMBER                        "],
       
       ["89","BAG STUFFER FLYER NOVEMBER                        "],
       
       ["78","BAG STUFFER WINDOW SIGNS DECEMBER                 "],
       
       ["77","BAG STUFFER WINDOW SIGNS NOVEMBER                 "],
       
       ["35","BATTERIES                                         "],
       
       ["17","BONUS , VALUE PACKS                               "],
       
       ["22","CANDY AND GUM                                     "],
       
       ["49","CANDY AND GUM - SUGARFREE                         "],
       
       ["25","COSMETICS                                         "],
       
       ["52","COUGH &amp; COLD LIQUIDS                              "],
       
       ["21","DIABETIC NEEDS                                    "],
       
       ["42","DIAGNOSTICS                                       "],
       
       ["16","DISPLAYS, FLOORSTANDS                             "],
       
       ["33","ELECTRONICS                                       "],
       
       ["43","ETHNIC                                            "],
       
       ["26","FAMILY PLANNING                                   "],
       
       ["44","FILM, CAMERAS, &amp; VIDEO                            "],
       
       ["32","FOOD ITEMS                                        "],
       
       ["5","FRAGRANCES MEN                                    "],
       
       ["45","FRAGRANCES WOMEN                                  "],
       
       ["54","GENERIC ANTIBIOTICS                               "],
       
       ["13","GENERIC SPECIALS                                  "],
       
       ["53","GENERIC TOPICALS                                  "],
       
       ["8","GENERICS NEW                                      "],
       
       ["7","HBA\&#039;S NEW                                         "],
       
       ["41","HOME APPLIANCES                                   "],
       
       ["3","HOME HEALTH CARE                                  "],
       
       ["14","HOME HEALTH CARE (NEW)                            "],
       
       ["4","HOME HEALTH CARE MONTHLY SPECIALS                 "],
       
       ["93","HOME HEALTH CARE TOP 40                           "],
       
       ["36","HOMEOPATHIC                                       "],
       
       ["31","HOUSEHOLD GOODS                                   "],
       
       ["9","INJECTABLES                                       "],
       
       ["29","INSULIN                                           "],
       
       ["50","NEVER OUT OF STOCK ITEMS                          "],
       
       ["30","NUTRITIONALS                                      "],
       
       ["56","OTC PRODUCTS CONTAINING PSE                       "],
       
       ["46","PERSONAL CARE APPLIANCES                          "],
       
       ["51","PET SUPPLIES                                      "],
       
       ["59","PHARMACY FIRST                                    "],
       
       ["40","PHARMACY SUPPLIES (MISC)                          "],
       
       ["55","PRE-BOOK ITEMS                                    "],
       
       ["20","PREFERRED PLUS (KPP) NEW                          "],
       
       ["2","PREFERRED PLUS (P/L) KPP                          "],
       
       ["10","RX BAGS (PHARMACY SUPPLIES)                       "],
       
       ["12","RX SPECIALS                                       "],
       
       ["6","RX\&#039;S NEW                                          "],
       
       ["24","SCHOOL SUPPLIES                                   "],
       
       ["15","SUMMER                                            "],
       
       ["60","SUNGLASSES/EYEGLASSES                             "],
       
       ["47","SYRINGES, NEEDLES, ACCESSORIES                    "],
       
       ["34","TOYS &amp; GAMES                                      "],
       
       ["18","TRIAL &amp; TRAVEL SIZES                              "],
       
       ["39","VIALS &amp; BOTTLES (PHARMACY SUPPLIES)               "],
       
       ["23","VITAMINS                                          "],
       
       ["37","WETS &amp; DRYS                                       "],
       
       ["",""]
       
       ];
       
       var titleSearch='';
    
       function DisplayCategories (table) {
          document.write("<TABLE class=searchTable border =0  cellPadding=0 cellSpacing=0 >");
          var k=0;
          for(var x=0; x<=(table.length-1); x++) {
             if(x%20==0)
                document.write("<TD>");
             document.write("<a href =\"javascript:parent.parent.frames.search.loadCategory(categories["+x+"][0], categories["+x+"][1])\">",table[x][1],"</a><BR>");
          }
          document.write("</TABLE>");
       }
       
       DisplayCategories(categories);
       top.setKeyHandlers(document);
    </script>
    </head>
    <body>
    </BODY>
    </HTML>
        
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.