Return of content by cURL [closed]

0

I am developing an automatic ticket generator, using a tool provided by Banrisul. To generate this automatic ticket I need to send a request through the following URL:      link

The data I reported on this link are fictitious, would you like to know how best to get the return of this automatically generated cURL ticket? How can I make the ticket open in a way that makes printing easier?

Thank you.

    
asked by anonymous 04.09.2014 / 03:07

3 answers

2

Be careful with the CURLOPT_SSL_VERIFYPEER it from being set to true to verify the secure connection (I've already suffered a lot from it).

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);

Second, to display it there with cURL just retrieve the response from curl_exec and print it to your users. I think you should not change the print option that the bank already makes available, it is good and works well in any browser.

    
04.09.2014 / 13:08
2

If I understand correctly you are asking how you can get the return of cURL. In this case I recommend using the function curl_setopt , passing by parameter:

  • The cURL connection
  • The CURLOPT_RETURNTRANSFER
  • 1 or true

Passing these options tells cURL that the url's return should come back to you when invoking curl_exec instead of being displayed directly in the browser.

    
04.09.2014 / 16:35
1

About printing, Banrisul already provides a link on the page generated with this functionality.

In your case, I would open the link in a pop-up and let the person click on the print.

    
04.09.2014 / 04:27