I have the following code:
$this->video->videoupdate($userid, $title, $id);
redirect("admin/videos", "refresh");
But the redirect is not working and I don't know why (I am using CodeIgniter)
I have the following code:
$this->video->videoupdate($userid, $title, $id);
redirect("admin/videos", "refresh");
But the redirect is not working and I don't know why (I am using CodeIgniter)
Have you sent anything to the browser prior to calling redirect? From the user guide
Note: In order for this function to work it must be used before anything is outputted to the browser since it utilizes server headers.
have you loaded the URL helper?
$this->load->helper('url');
Load this in your controller. I usually put mine either in the constructor or the autoload config.
try this :
redirect("admin/videos");
without "refresh"
Check your htaccess, write like this:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|assets|robots\.txt)
RewriteBase /sitename/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d``
RewriteRule ^(.*)$ /index.php [L]
I have just fixed it with this ->
$config['base_url'] = 'http://localhost:3000/';
So apparently you must define this before use your url helper.