I call qrcode in the Controller of Codeigniter. The generated image is always broken. But it is normal in a non-Codeigniter framework. I don't know where the error is. Thank you !! The following is my code: My controller (the q_interface file is already a... can you tell me that I call qrcode in the Controller of Codeigniter, And the generated image is always broken.
But it is normal in a non-Codeigniter framework. I don't know where the error is. Thank you !!
The following is my code:
My controller (the q_interface file has been autoload ):
class Qrcode3 extends CI_Controller { public function __construct() { parent::__construct(); } public function index() { echo $this->q_interface->t("abc"); }}
Q_interface file:
... // Include the class Q_interface {public function t ($ data) {$ img = QRcode: png ($ data); $ imgData = "data: image/png; base64 ,". base64_encode ($ img); return $ imgData ;}}
Reply content:
I call qrcode in the Controller of Codeigniter. The generated image is always broken.
But it is normal in a non-Codeigniter framework. I don't know where the error is. Thank you !!
The following is my code:
My controller (the q_interface file has been autoload ):
class Qrcode3 extends CI_Controller { public function __construct() { parent::__construct(); } public function index() { echo $this->q_interface->t("abc"); }}
Q_interface file:
... // Include the class Q_interface {public function t ($ data) {$ img = QRcode: png ($ data); $ imgData = "data: image/png; base64 ,". base64_encode ($ img); return $ imgData ;}}