Currently I am working on one Web-based software which creates results automatically in codeigniter. I create modules like add student, add marks & generate mark sheet. here in generate marksheet i created individual marksheet but now I want to generate code for generate marksheet on one button click.
For that i use file_get_content(), curl(), fopen() but this all showing blank page if file_get_content("http://127.0.0.1/exam/admission/forms/showResult/41/2/1")
shows individual students result i want to show it in page
Here is My controller code
class forms extends CI_Controller {
function __construct() {
parent::__construct();
$this->admin_layout->setLayout('template/layout_admission');
$session = $this->session->userdata('admin_session');
if (empty($session) || $session->type != 'admission') {
$this->session->set_flashdata('error', 'Login First');
redirect(base_url() . 'login', 'refresh');
}
function printDoc(){
$siteaddressAPI = "http://127.0.0.1/exam/admission/forms/showResult/41/2/1";
$data = file_get_contents($siteaddressAPI);
echo $data;
}
}