Welcome Guest, Not a member yet? Register   Sign In
Don't redirect
#1

[eluser]mikevu[/eluser]
Hello,
I have a form to update.
When I update my data complete but redirect don't run
This is my code:
if ($this->form_validation->run() == TRUE)
{
$this->settings->update_settings(); //OK, tested;
$this->session->set_flashdata('message', lang('successfully_updated')); //OK tested
redirect('admin/settings', 'refresh'); // Don't work. WHY??

}

Please Help me.
Thank
#2

[eluser]Dam1an[/eluser]
Does it work with the default location redirect? (without the second parameter)
Do you send any output to the screen before calling this (need error reporting on to see this)
#3

[eluser]Jondolar[/eluser]
You might want to turn on error logging to see if you are getting an error that is preventing the script from running to completion.
#4

[eluser]mikevu[/eluser]
Hello,
Thank you for your help.
I intergate a plugin for fckeditor, When I config to autoload the plugin, it can't redirect.
Please help me to solution.

Thank

This is the plugin
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');

include_once( BASEPATH . '/helpers/form_helper'.EXT);

function form_fckeditor($data = '', $value = '', $extra = '')
{

$CI =& get_instance();

$fckeditor_basepath = $CI->config->item('fckeditor_basepath');
require_once( $_SERVER["DOCUMENT_ROOT"] . $fckeditor_basepath. 'fckeditor.php' );

$instanceName = ( is_array($data) && isset($data['name']) ) ? $data['name'] : $data;
$fckeditor = new FCKeditor($instanceName);

if( $fckeditor->IsCompatible() )
{
$fckeditor->Value = html_entity_decode($value);
$fckeditor->BasePath = $fckeditor_basepath;
if( $fckeditor_toolbarset = $CI->config->item('fckeditor_toolbarset_default'))
$fckeditor->ToolbarSet = $fckeditor_toolbarset;

if( is_array($data) )
{
if( isset($data['value']) )
$fckeditor->Value = html_entity_decode($data['value']);
if( isset($data['basepath']) )
$fckeditor->BasePath = $data['basepath'];
if( isset($data['toolbarset']) )
$fckeditor->ToolbarSet = $data['toolbarset'];
if( isset($data['width']) )
$fckeditor->Width = $data['width'];
if( isset($data['height']) )
$fckeditor->Height = $data['height'];
}

return $fckeditor->CreateHtml();
}
else
{
return form_textarea( $data, $value, $extra );
}

}

?>
#5

[eluser]Johan André[/eluser]
Try removing the PHP-closing tag from the file. Actually you should NEVER use a closing tag at the end of files when defining your controller, models and views.

Sometimes it outputs whitespace after the closing-tag and that can create issues with the redirect (and some other strange problems).
#6

[eluser]mikevu[/eluser]
Hi Johan,
Thank for your help.
there is no problem with me.




Theme © iAndrew 2016 - Forum software by © MyBB