[Codeigniter-users] javascriptのalert

Back to archive index

usagi****@ezweb***** usagi****@ezweb*****
2009年 3月 10日 (火) 23:26:29 JST


kunitsujiです

それは、configだったかな?URIの文字で日本語が通るようにすれば行ける気がします。
ユーザ会のサイトのティップスでURIで日本語を使う、を参考にしてみて下さい。
携帯で見てるので的外れだったらすみません


>こんばんは
>javascriptのalertを使ってみようと思いhttp://d.hatena.ne.jp/KuniTsuji/20080617/1213685444にあったヘルパーをコピーさせていただいて
>/application/helpersにjava_helper.phpで保存しました。
>
>やったこと。
>test.php
><?php
>
>class Test extends Controller {
>
>  function Test(){
>  parent::Controller();
> }
>  
> function index($a = null){
>  $this->load->helper('java');
>  $data['title'] = "test";
>  $data['headline'] = "test";
>  $data['message'] = $a;
>  $this->load->view('template', $data);
>        }
>
> function check(){
>  submitボタンが押された時
>  $a = "error";
>
>  redirect("test/index/$a");
> }
>}
>?>
>
>template.php
><html>
><head>
><meta http-equiv="content-type" content="text/html; charset=Shift_JIS">
><title><?php echo $title;?></title>
><div align="center"><h1><?php echo $headline;?></h1></div>
> 
> echo form_open('test/check');でsubmitボタンをつくっています。
>
> </form>
> <? if ($message != ""){
> echo js_codeBlock("alert('$message')");
> } ?>
></body>
></html>
>
>ボタンを押したらalertボックス(errorと表示)が出ますが$a = "error";に漢字をいれたり変数をいれたら「The URI you submitted has disallowed characters.」と表示されます。
>
>使い方が間違っているせいだと思いますが正しい使用方法をご教授お願いします。
>
>_______________________________________________
>Codeigniter-users mailing list
>Codei****@lists*****
>http://lists.sourceforge.jp/mailman/listinfo/codeigniter-users




Codeigniter-users メーリングリストの案内
Back to archive index