用户
 找回密码
 入住 CI 中国社区
搜索
查看: 4594|回复: 5
收起左侧

[已解决] 【HELP】请问超链接怎么写???

[复制链接]
发表于 2010-5-2 01:26:37 | 显示全部楼层 |阅读模式
本帖最后由 zhangcjl 于 2010-5-2 09:47 编辑

RT。。。。。。。
我在 http://localhost/codeigniter/index.php/welcome/index
http://localhost/codeigniter/index.php/welcome
http://localhost/codeigniter/index.php
http://localhost/codeigniter/
这几个链接页面有 echo "<a href='index.php/login/logout'>退出登陆</a>";这个链接

在http://localhost/codeigniter/index.php/welcome/index
http://localhost/codeigniter/index.php/welcome
http://localhost/codeigniter/index.php
  http://localhost/codeigniter/
这几个链接下面,
只有 http://localhost/codeigniter/index.php
  http://localhost/codeigniter/
这两个链接能正确跳转到控制器login,另外两个都有错误不能正确跳转,我不想把链接写成
<a href='http://localhost/codeigniter/index.php/login/logout'>退出登陆</a>

HELP,各位大侠帮帮小弟~~呵呵~~这里先谢谢了~~~
发表于 2010-5-2 10:13:11 | 显示全部楼层
好好看手册哦,使用url辅助函数
发表于 2010-5-2 19:16:16 | 显示全部楼层
site_url()
 楼主| 发表于 2010-5-2 22:00:30 | 显示全部楼层
回复 2# ywqbestever


     echo "<a href='index.php/login/logout'>退出登陆</a>";
这里我本来也想用site_url的,但是好像直接输出site_url()。。。。。。
 楼主| 发表于 2010-5-2 22:02:26 | 显示全部楼层
回复 3# Hex


    早上在群里,有人教我用<base>
我用<base href="<?=site_url('index.php/')?>"/>
就搞定了~~呵呵~~
谢谢~~
 楼主| 发表于 2010-5-2 22:02:55 | 显示全部楼层
回复 2# ywqbestever


    谢谢~~

本版积分规则