php地址中的这个参数有什么作用?
如http://localhost/index.php?12345http://localhost/index.php?id=12345
追问:第一个是什么意思
如http://localhost/index.php?12345http://localhost/index.php?id=12345
追问:第一个是什么意思
答案:你不清楚的应该是这里:http://localhost/index.php?12345这种写法应该是启用了URL重写,就是这种形式会被rewrite中的一条规则匹配,然后转化为制定的地址,比如 把 http://localhost/index.php?12345
转化成 http://localhost/index.php?id=12345。就是这个意思localhost表示是本地服务器,
?id=12345其中?为分隔符,表示其后是参数,id参数的名称,12345是参数的值
把id的值12345传递到首页
id=12345是这个么?我知道在ASP中这个是用来引导指向的网页,程序包中设置了很多ID,每个ID都引导一个地址,如http://localhost/index.php?id=12345进入指定页面。就像超链接一样。
参数不同代表着不同的域名第一个代表的是要传给index页里的参数
第二个是要访问的index页里的id=12345的东西也是传递参数的一种方式,可以直接用javascript通过截取URL来获取参数值。