フォームに入力した「ソ」のあとに半角の「¥」マークが付く - PHPプロ!Q&A掲示板

654

  • 0P

フォームに入力した「ソ」のあとに半角の「¥」マークが付く

質問日時 / 2007年9月17日 18:04    回答数 / 1件

Questioner:  Xplate  このエントリーをはてなブックマークに追加 

キーワード / 誤動作   

こんにちは
久しぶりの質問投稿になります

言葉では説明しにくいですが
現状はこうです

|ソ       |⇒送信ボタン⇒|ソ¥     |

となってしまいます
なお、これは「ソ」だけのことで(現状では)「ア」「ダ」「ン」などのほかの文字はこのような
症状が発生しません

問題のソースを投稿しますので問題点を指摘してください
Input.class.php
  1. // 確認ページの作成
  2.   public function privatecheck(){
  3.     $this->license = $_POST["license"];
  4.     $this->hurigana = $_POST["hurigana"];
  5.     $this->name = $_POST["name"];
  6.     $this->id = $_POST["id"];
  7.     $this->pass = $_POST["pw"];
  8.     $this->birthday = $_POST['birthday'];
  9.     $this->revision = $_POST['revision'];
  10.     $this->hurigana = mb_convert_kana($this->hurigana,"KVC","Shift_JIS");
  11.     mb_regex_encoding("SJIS");
  12.     // 入力のチェック
  13.     if ($this->db = sqlite_popen($this->DBfile,0660,$sqliteerror)){
  14.       if(isset($_POST["id"])){
  15.         //データを取り出す
  16.         // SQLiteに users テーブルがあるか調べる
  17.         $this->qstring = "select name from 'sqlite_master' where type='table' and name='users'";
  18.         $this->qresult = sqlite_query($this->db,$this->qstring);
  19.         $this->fresult = sqlite_fetch_array($this->qresult);
  20.         // SQLiteにテーブルがなければ users テーブルを作る
  21.         if(FALSE==$this->fresult){
  22.           $this->qstring = "create table users (idno integer primary key,user varchar(25),pass char(25),license varchar(5),hurigana varchar(15),name varchar(10),birthday int(8),handlename varchar(10),color varchar(5),taste varchar(15),job varchar(15),publicbirthday varchar(5),sex varchar(5),word varchar(15),coin int(15))";
  23.           $this->qresult = sqlite_query($this->db,$this->qstring);
  24.         }
  25.         // SQLiteに messages テーブルがあるか調べる
  26.         $this->mqstring = "select name from 'sqlite_master' where type='table' and name='messages'";
  27.         $this->mqresult = sqlite_query($this->db,$this->mqstring);
  28.         $this->mfresult = sqlite_fetch_array($this->mqresult);
  29.         // SQLiteに messages テーブルがなければ messages テーブルを作る
  30.         if(FALSE==$this->mfresult){
  31.           $this->mqstring = "create table messages (idno integer primary key,user varchar(25),messagetitle varchar(15),messageno varchar(15),message text)";
  32.           $this->mqresult = sqlite_query($this->db,$this->mqstring);
  33.         }
  34.         // SQLiteに products テーブルがあるか調べる
  35.         $this->pqstring = "select name from 'sqlite_master' where type='table' and name='products'";
  36.         $this->pqresult = sqlite_query($this->db,$this->pqstring);
  37.         $this->pfresult = sqlite_fetch_array($this->pqresult);
  38.         // SQLiteに products テーブルがなければ products テーブルを作る
  39.         if(FALSE==$this->pfresult){
  40.           $this->pqstring = "create table products (idno integer primary key,productname varchar(25),filea text,fileb text,filec text,productmessage text,priceyen int(10),pricecoin int(10),shopno int(10))";
  41.           $this->pqresult = sqlite_query($this->db,$this->pqstring);
  42.         }
  43.         // SQLiteに logs テーブルがあるか調べる
  44.         $this->lqstring = "select name from 'sqlite_master' where type='table' and name='logs'";
  45.         $this->lqresult = sqlite_query($this->db,$this->lqstring);
  46.         $this->lfresult = sqlite_fetch_array($this->lqresult);
  47.         // SQLiteに logs テーブルがなければ logs テーブルを作る
  48.         if(FALSE==$this->lfresult){
  49.           $this->lqstring = "create table logs (idno integer primary key,user varchar(25),boughtday int(12),productname varchar(25),priceyen int(10),pricecoin int(10))";
  50.           $this->lqresult = sqlite_query($this->db,$this->lqstring);
  51.         }
  52.         // SQLiteに faqs テーブルがあるか調べる
  53.         $this->fqstring = "select name from 'sqlite_master' where type='table' and name='faqs'";
  54.         $this->fqresult = sqlite_query($this->db,$this->fqstring);
  55.         $this->ffresult = sqlite_fetch_array($this->fqresult);
  56.         // SQLiteに faqs テーブルがなければ faqs テーブルを作る
  57.         if(FALSE==$this->ffresult){
  58.           $this->fqstring = "create table faqs (idno integer primary key,question varchar(25),answer text)";
  59.           $this->fqresult = sqlite_query($this->db,$this->fqstring);
  60.         }
  61.  
  62.         $this->qstring = "select pass from users where user='{$this->id}'";
  63.         $this->qresult = sqlite_query($this->db,$this->qstring);
  64.         $count = sqlite_num_rows($this->qresult);
  65.         $today = getdate(); $year=sprintf("%04d",$today['year']); $month=sprintf("%02d",$today['mon']); $day=sprintf("%02d",$today['mday']);
  66.         $nenrei=(int)((($year*10000)+($month*100)+$day - $this->birthday)/10000);
  67.         $this->birthy = substr($this->birthday,0,4); $this->birthm = substr($this->birthday,4,2); $this->birthd = substr($this->birthday,-2);
  68.         if($nenrei < 20 and V==$this->license)
  69.           { $this->errorm["license"]["mess"] = "※"; $this->errorm["elicense"]["mess"] = "ライセンス:誤選択 "; $this->errors++; }
  70.         if(0==mb_strlen($this->hurigana))
  71.           { $this->errorm["hurigana"]["mess"] = "※"; $this->errorm["ehurigana"]["mess"] = "フリガナ:未入力 "; $this->errors++; }
  72.         elseif(!mb_ereg("([ァ-ヶ]) ([ァ-ヶ])+$",$this->hurigana))
  73.           { $this->errorm["hurigana"]["mess"] = "※"; $this->errorm["ehurigana"]["mess"] = "フリガナ:誤入力 "; $this->errors++; }
  74.         if(0==mb_strlen($this->name))
  75.           { $this->errorm["name"]["mess"] = "※"; $this->errorm["ename"]["mess"] = "名前:未入力 "; $this->errors++; }
  76.         elseif(!mb_ereg("([ぁ-んァ-ヶ亜-腕弌-黑纊-黑]) ([ぁ-んァ-ヶ亜-腕弌-黑纊-黑])+$",$this->name))
  77.           { $this->errorm["name"]["mess"] = "※"; $this->errorm["ename"]["mess"] = "名前:誤入力 "; $this->errors++; }
  78.         if(0==mb_strlen($this->id))
  79.           { $this->errorm["id"]["mess"] = "※"; $this->errorm["eid"]["mess"] = "PASSID:未入力 "; $this->errors++; }
  80.         elseif(!preg_match('/^[a-zA-Z0-9_\.\-]+?@[A-Za-z0-9_\.\-]+$/',$this->id))
  81.           { $this->errorm["id"]["mess"] = "※"; $this->errorm["eid"]["mess"] = "PASSID:誤入力 "; $this->errors++; }
  82.         elseif(sqlite_num_rows($this->qresult) > 0)
  83.           { $this->errorm["id"]["mess"] = "※"; $this->errorm["eid"]["mess"] = "PASSID:ID重複 "; $this->errors++; }
  84.         if(0==strlen($this->pass))
  85.           { $this->errorm["pw"]["mess"] = "※"; $this->errorm["epw"]["mess"] = "PASSWORD:未入力 "; $this->errors++; }
  86.         elseif(!mb_ereg("([a-zA-Z0-9])+$",$this->pass))
  87.           { $this->errorm["pw"]["mess"] = "※"; $this->errorm["epw"]["mess"] = "PASSWORD:誤入力 "; $this->errors++; }
  88.         if(0==strlen($this->birthday))
  89.           { $this->errorm["birthday"]["mess"] = "※"; $this->errorm["ebirthday"]["mess"] = "生年月日:未入力 "; $this->errors++; }
  90.         elseif(!mb_ereg("([0-9]{8})+$",$this->birthday))
  91.           { $this->errorm["birthday"]["mess"] = "※"; $this->errorm["ebirthday"]["mess"] = "生年月日:誤入力"; $this->errors++; }
  92.         if($this->license == "S"){ $this->license = "Standard";$this->coin = 1000; }
  93.         if($this->license == "V"){ $this->license = "VIP";$this->coin = 10000; }
  94.         $this->revision = 1;
  95.         if(1 == $this->check){ $_SESSION["form1"] = "publicinput"; }
  96.         elseif(0 == $this->errors){ $_SESSION["form1"] = "privatechecked"; }
  97.       }
  98.     }
  99.   }
privateinput.tpl
  1. <form action=input.php method=post>
  2.  
  3. <FONT size="2"> 新しく X-plate Account を作成します。<BR>
  4. </FONT>
  5. <FONT size="2"> はじめに、個人情報を登録いたしますので、必要事項を入力して「確認」をクリックしてください。<BR>
  6. </FONT>
  7. <FONT size="2"> <font color=orange>{$error.elicense.mess}{$error.ehurigana.mess}{$error.ename.mess}{$error.ehandlename.mess}{$error.eid.mess}{$error.epw.mess}{$error.ebirthday.mess}<BR>
  8. </FONT>
  9. <FONT size="2"> お申し込みライセンス(Guest Lisence は登録不要です。<strike>また、20歳未満のお客様は VIP Lisence を作成できません。</strike>)<BR>
  10. </FONT>
  11. <FONT size="2">  <font color=red>{$error.license.mess}</font>
  12. {if $license == "Standard"}<input type = "radio" name = "license" value = "S" checked>Standard <input type="radio" name = "license" value = "V" disabled>VIP(準備中)
  13. {elseif $license == "VIP"}<input type = "radio" name = "license" value = "S">Standard <input type="radio" name = "license" value = "V" disabled>VIP(準備中)
  14. {else}<input type = "radio" name = "license" value = "S" checked>Standard <input type="radio" name = "license" value = "V" disabled>VIP(準備中)
  15. {/if}<BR>
  16. </FONT>
  17. <FONT size="2"> お名前(姓と名の間に全角スペースを入れてください)<BR>
  18. </FONT>
  19. <FONT size="2">  フリガナ<font color=red>{$error.hurigana.mess}</font><input type=text name=hurigana value="{$hurigana}" size=30 maxlength=15><BR>
  20. </FONT>
  21. <FONT size="2">  名前  <font color=red>{$error.name.mess}</font><input type=text name=name value="{$name}" size=30 maxlength=10><BR>
  22. </FONT>
  23. <FONT size="2"> PASSID(連絡が取れるメールアドレスをご入力ください)<BR>
  24. </FONT>
  25. <FONT size="2">  <font color=red>{$error.id.mess}</font><input type=text name=id value="{$id}" size=30 maxlength=25><BR>
  26. </FONT>
  27. <FONT size="2"> PASSWORD(半角英数字で入力。連番など、他人に認識されやすいものは控えてください)<BR>
  28. </FONT>
  29. <FONT size="2">  <font color=red>{$error.pw.mess}</font><input type=password name=pw value="{$passwd}" size=30 maxlength=25><BR>
  30. </FONT>
  31. <FONT size="2"> 生年月日(半角数字のみで入力。例:1992年8月26日の生まれ場合 ⇒ 19920826)<BR>
  32. </FONT>
  33. <FONT size="2">  <font color=red>{$error.birthday.mess}</font><input type=text name=birthday value="{$birthday}" size=30 maxlength=8><BR>
  34. </FONT>
  35. <FONT size="2"><BR>
  36. </FONT>
  37. <FONT size="2"><TABLE><TR><TD> <input type=reset name=reset value=" 消去 ">  <input type=submit name=submit value=" 確認 >> "></form></TT></TR></TABLE>
  38. </FONT>
よろしくお願いします

この質問への意見の募集は締め切られ、ポイントは既に配分されました。
意見を投稿することはできますが、ポイントを受け取ることはできません。



ツリー一覧

回答一覧

並び替え:

A01 満足
answererTorrySegall [9月19日 04:52]

http://www.shtml.jp/mojibake/sjis_cgi.html

この意見に回答する

ツリーへ TOPへ

<<質問一覧へ



Pick Up Q&A

Q
動的なURLを静的に見せる方法
 このエントリーをはてなブックマークに追加 
A
普通に考えて、mod_rewrite でしょうね。 http://www.nishishi.com/blog/2006/01/mod_rewrite_url.html...

>>続きを読む

GETのままでは検索エンジンのロボットが拾ってくれなかったためにSEO対策として有効だと言われていますね。

▲解説者:岡本(アシアル株式会社 教育コーディネーター兼 システムエンジニア)