TCPDF I can't get the html from another page like index.php?something=something -
i struggling create pdf file tcpdf dynamically generated page.
my problem i've got logging session , when accessing file gets credentials if you're not logged in.
so bit collecting html is:
$curl_handle=curl_init(); curl_setopt($curl_handle, curlopt_url,'http://www.domain.com/subdir/index.php?something=ref'); curl_setopt($curl_handle, curlopt_connecttimeout, 2); curl_setopt($curl_handle, curlopt_returntransfer, 1); curl_setopt($curl_handle, curlopt_useragent, 'your application name'); $html = curl_exec($curl_handle); curl_close($curl_handle);
so i've got after running it, 'http error 401: - unauthorised'.
i hope explanation makes sense.
any appreciated!
i had same issue while working pdf using tcpdf in curl curlopt_useragent tcpdf below.
curl_setopt($curl_handle, curlopt_useragent, 'tcpdf');
i commented line , try generate pdf , worked.
i know not proper way worked me.
Comments
Post a Comment