Hi,
I have everything working so far with CSRF and fire fox.
How ever when I submit my form on google chrome my
form validation error messages do not show up.
But the show up in fire fox? Any suggestions
Unless it's because CSRF is protecting form so I can only use one browser at a time?
I have attached the view
PHP Code:
$config [ 'cookie_prefix' ] = 'ci_' ; $config [ 'cookie_domain' ] = '.localhost' ; $config [ 'cookie_path' ] = '/' ; $config [ 'cookie_secure' ] = FALSE ; $config [ 'cookie_httponly' ] = TRUE ; $config [ 'csrf_protection' ] = TRUE ; $config [ 'csrf_token_name' ] = 'my_post_key' ; $config [ 'csrf_cookie_name' ] = 'cookie_name' ; $config [ 'csrf_expire' ] = 7200 ; $config [ 'csrf_regenerate' ] = TRUE ; $config [ 'csrf_exclude_uris' ] = array();
PHP Code:
<?php class Newthread extends CI_Controller { public function __construct () { parent :: __construct (); $this -> load -> library ( 'form_validation' ); $this -> load -> model ( 'newthread_model' ); $this -> load -> helper ( 'smiley' ); } public function index () { $data [ 'title' ] = 'Newthread in ' . $this -> newthread_model -> get_forum_title ( $this -> uri -> segment ( 2 )); if ( $this -> input -> post ( 'preview_submit' )) { $data [ 'preview' ] = parse_smileys ( $this -> input -> post ( 'message' ), base_url ( 'assets/images/smileys/' )); } else { $data [ 'preview' ] = '' ; } $data [ 'smiley_table' ] = get_clickable_smileys ( base_url ( 'assets/images/smileys/' ), 'message' ); $this -> form_validation -> set_rules ( 'subject' , 'subject' , 'required' ); if ( $this -> form_validation -> run () == false ) { $this -> load -> view ( 'header' , $data ); $this -> load -> view ( 'newthread' , $data ); $this -> load -> view ( 'footer' ); } else { if ( $this -> input -> post ( 'preview_submit' )) {} if( $this -> input -> post ( 'newthread_submit' )) { redirect ( "forum/" . $this -> uri -> segment ( 2 )); } } } }
Attached Files
newthread.php (Size: 3.99 KB / Downloads: 118)
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!