想用PATH_INFO功能。但是不知道应该加到哪里?
这是一个查看网页源代码的功能
网址是这样的
http://www.vipcha.net/5/
我想实现的功能是这样的
http://www.vipcha.net/5/www.baidu.com //在原来的基础上增加一个网址。
代码如下: 请高手指点一下。谢谢
- PHP code
<!---ecms Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><?php$hu = 'yuan';@require_once('global.php');$domain = $_POST['domain'];if($domain){ is_domain($domain) or exit( "<script language=javascript>alert('请输入正确的域名!');location.href='index.php';</script>"); $content = @file_get_contents("http://".$domain); @require_once('cache.php'); if(file_exists("cache/cache.php")){ @require_once("cache/cache.php"); $urls = filehave($urls,$domain); }else{ $urls = fileno($domain); } writeover("cache/cache.php","<?php\r\n\$urls=".vvar_export($urls).";\r\n?>");}?><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>网页源代码查看器</title>"/> <textarea id="content" name="content" style="width:750px;height:850px;border:1px solid #c5e2f2;overflow:visible" cols="20" rows="65"><?php echo $content;?></textarea></div>最近查询<table><tr><td align="left"><?php@require_once('cache/cache<i>·本2文来源gaodai$ma#com搞$代*码网2</i><strong>搞gaodaima代码</strong>.php');if($urls){foreach ($urls as $key=>$v){ echo "".$urls[$key]." ";}}?></td></tr></table>
——解决方案——————–
表单不要提交
用js跳转
服务器接受参数,启用rewrite
——解决方案——————–
- PHP code
<?php//在哪都能加$path_parts = pathinfo($_SERVER['REQUEST_URI']);print_r($path_parts);?>
------解决方案--------------------
网址是这样的 www.vipcha.net/5/
那么你实际访问的是 www.vipcha.net/5/index.php
如果那个 5/ 适当做参数时 那要这样才行 www.vipcha.net/index.php/5
这就是 PATH_INFO我想实现的功能是这样的
www.vipcha.net/5/www.baidu.com
这就需要 urlrewrite 了,因为需要隐藏php文件名