热搜:NVER node 开发 php

中文URL传值问题,很难的

2024-09-17 20:30:01
中文URL传值问题,很难的

比如url是   http://x.com/index.php?module=音乐&type=英文歌

通过 htacess 重写为  http://x.com/音乐_英文歌.html



php 里面这样写

$type = $_GET['type'];  或者  $type = urldecode($_GET['type']);

$sql = mysql_query("select * from music where type = '$type'");
....


可是访问url就显示找不到该页   怎么办呢  


回复讨论(解决方案)

你 print_r($_GET); 看看都是些什么

原来是正则的问题  

#页面
RewriteRule ^(.*).html$ ?m=$1 

# 子页面
RewriteRule ^(.*)_(.*).html$ ?m=$1&d=$2

求教  如果是 父页面_子页面.html  这样的结构  如果让系统不把 “父页面_子页面”当成一个参数而是当成两个呢?