熟悉wap 编码转码问题的请进,1000分求解,解决了绝对给1000分,急!

sakura169 2003-08-21 09:49:35
已经有一套搜索的程序

问题:在手机上输入内容(汉字或者英文),提交给第二个页面,第二个页面再用
搜索的关键词调用搜索的程序,显示搜索的结果。
现在的问题出现在提交过来的内容的编码怎样转化才能被搜索程序正常使用。
注:直接将搜索内容提交给搜索程序识没问题的。

...全文
124 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
StudentIT 2004-01-16
  • 打赏
  • 举报
回复
用PHPiconv函数,直接转化就行了。
mwjx 2003-12-23
  • 打赏
  • 举报
回复
mark
「已注销」 2003-08-22
  • 打赏
  • 举报
回复
用unicode吧。这个是标准。。。

wap的俺也做过,没有你说的那么复杂,跟做web都是一样的。只不过html换成wml啦。

php的用法一点都没变~!
okdw 2003-08-22
  • 打赏
  • 举报
回复
编码问题,因为普通网页传递的时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
shuiaaa 2003-08-22
  • 打赏
  • 举报
回复
<?
$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编码你看哪个好用吧!!!!
//__我已在自已机上测试过了!!!!
?>
xuzuning 2003-08-22
  • 打赏
  • 举报
回复
怎么发送的就怎么接收
sakura169 2003-08-22
  • 打赏
  • 举报
回复
偶知道了

--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])

redhatcn 2003-08-22
  • 打赏
  • 举报
回复
用UNICODE
liyujie2000 2003-08-22
  • 打赏
  • 举报
回复
===================
采用一种编码,比如说是base64编码,然后再解码, 看这样可不可以。
===================
建议用 Unicode
myblessu 2003-08-22
  • 打赏
  • 举报
回复
惭愧,一直没做过与手机短信有关的东东.
vitalgg 2003-08-22
  • 打赏
  • 举报
回复
在接收方编码
base64_encode($_POST['$a']);
base64_encode($_POST["\$a"]);
sakura169 2003-08-22
  • 打赏
  • 举报
回复
问题还没有解决:
代码如下:
<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编码?
sakura169 2003-08-22
  • 打赏
  • 举报
回复
楼上的不要说风凉话!
scalps 2003-08-22
  • 打赏
  • 举报
回复

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

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧