Welcome Guest, Not a member yet? Register   Sign In
How can I load index() without memory leak?
#1

[eluser]cleansugar[/eluser]
hello.php:

funtion Hello()
{}

function index()
{}

function submit()
{
$name = $this->input->post('formname');
$this->hello_model->insertData($name);
Hello::index();
}

I want to load index page after loading submit() page.
But Hello::index() requires memory at each time it loads recursively.
How can I load index() without memory usage?

I've used redirect(). but it returns error like "duplicated index load".

Please help me.
#2

[eluser]David Johansson[/eluser]
why won't $this->index(); work? also i don't understand you error with redirect...
#3

[eluser]cleansugar[/eluser]
$this->index() results memory consume, too.

redirect('/hello/index'); makes this error.

What can I do?

A PHP Error was encountered
Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at C:\hello\system\application\models\hello_model.php:29)

Filename: helpers/url_helper.php

Line Number: 541
#4

[eluser]David Johansson[/eluser]
Well redirect relies on http headers, if the headers are already set you can not use redirect. The header are automatically set when you make any kind of output (e.g by using echo)
#5

[eluser]David Johansson[/eluser]
why are you so afraid of consuming memory? you can't do anything without consuming memory...
#6

[eluser]cleansugar[/eluser]
Thank you a lot. echo was problem.




Theme © iAndrew 2016 - Forum software by © MyBB