采用一种编码,比如说是base64编码,然后再解码, 看这样可不可以。

解决方案 »

  1.   

    ===================
    采用一种编码,比如说是base64编码,然后再解码, 看这样可不可以。
    ===================
    建议用 Unicode
      

  2.   

    <?
    $data="http://localhost/zshang.php?func=xianxi&fenid=2&id=20";
    $j=base64_encode($data);
    echo "base64_encode的加密:".$j;
    $j1=base64_decode($j);
    echo "<hr>base64_decode的解密:".$j1;
    //_本人特意为你写的!!看你有没用!!!64位编码
    $str=urlencode($data);
    echo "<hr>编码加密:".$str;
    $str1=urldecode($str);
    echo "<hr>编码解密:".$str1;
    //__URL编码你看哪个好用吧!!!!
    //__我已在自已机上测试过了!!!!
    ?>
      

  3.   

    编码问题,因为普通网页传递的时urlencode,之后可以自动解码。wml需要先encode,然后decode.  For example:(PHP)
    <p>传递变量:
    <do type="accept" label="OK">
    <go href="ok.php" method="post">
    <postfield name="myname" value="<?=base64_encode("我是变量");?>"/>
    </go>
    </do>
    </p>
    Next Page
    <p>myname is:<?=base64_decode($myname);?>
    </p>http://expert.csdn.net/Expert/topic/2114/2114876.xml?temp=.6523859
      

  4.   

    用unicode吧。这个是标准wap的俺也做过,没有你说的那么复杂,跟做web都是一样的。只不过html换成wml啦。php的用法一点都没变~!
      

  5.   

    问题还没有解决:
    代码如下:
    <wml>
    <card id="monternet" title="test">
    <?php echo(gb2u("请输入服务名称:"));?><input name="a" maxlength="50" /><br/>
    <anchor>[<?php echo(gb2u("开始搜索"));?> ]
    <go href="http://XXX/search/result.wml" method="post">
        <postfield name="name" value="$a" />
    </go>
    </anchor>
    <a href="http://wap.monternet.com"><?php echo(gb2u("[返回]")); ?></a>
    </p>
    </card>
    </wml>问题:怎样在将$a进行base64编码?
      

  6.   

    在接收方编码
    base64_encode($_POST['$a']);
    base64_encode($_POST["\$a"]);
      

  7.   

    偶知道了--enable-mbstring : Enable mbstring functions. This option is required to use mbstring functions. 注: As of PHP 4.3.0, the option --enable-mbstring will be enabled by default and replaced with --with-mbstring[=LANG] to support Chinese, Korean and Russian language support. Japanese character encoding is supported by default. If --with-mbstring=cn is used, simplified chinese encoding will be supported. If --with-mbstring=tw is used, traditional chinese encoding will be supported. If --with-mbstring=kr is used, korean encoding will be supported. If --with-mbstring=ru is used, russian encoding will be supported. If --with-mbstring=all is added, all supported character encoding in mbstring will be enabled, but the binary size of PHP will be maximized because of huge Unicode character maps. Note that Chinese, Korean and Russian encoding is experimentally supported in PHP 4.3.0. 手机传过来的是utf-8编码,php重新编译后用
    string mb_convert_encoding ( string str, string to-encoding [, mixed from-encoding])
      

  8.   

    用PHPiconv函数,直接转化就行了。