Jump to content
  • 0

Getting Content Of A Page By Curl


AllToolKits.com

Question

I am doing a wordpress plugin that fetch blesta pages using curl. Did login to blesta.

 

When i try to access content of the below link using curl

domain.com/admin/widget/system_overview/admin_main/

 

i'm getting content of page

domain.com/admin/

not that of

domain.com/admin/widget/system_overview/admin_main/

 

Code is below

 

 $tempurl =  'http://domain.com/admin/widget/system_overview/admin_main/';
 $ch = curl_init();
 curl_setopt($ch,CURLOPT_URL,  $tempurl);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                //curl_setopt($ch, CURLOPT_POST, 1);
                //curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST);
               // curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
   $buffer = curl_exec($ch);    
   echo $buffer;           
   curl_close($ch);

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...