1

I am making a report with fpdf. My problem is I want to call the function that using fpdf class in new window after processing save to database, like this: I can figure like this 1. First I have to save to the database, with the data posted form form html. 2. Call fpdf function to print the result with the same data with the first process. 3. redirect to index function to show that data has been saved into database.

my code like this :

//save to database
$this->My_model->insert($data);

//call the pdf function
$this->print_the_result($data);

//redirect
redirect('my_class/index');
4

1 回答 1

0

Codeigniter 的重定向仅适用于它操作的窗口,因为服务器不知道有关客户端(浏览器)的任何信息。

(一般解释的)解决方法在http://codeigniter.com/forums/viewthread/110435/#557038进行了解释:

“您需要将它们发送到带有 HTML 输出的页面,该页面使用 JavaScript 打开新窗口”

话虽如此,您可能需要 View 模块的一些帮助来进行重定向。

于 2012-06-29T13:30:34.160 回答