Welcome Guest, Not a member yet? Register   Sign In
Hyperlink problem
#1

[eluser]harris_priambudi[/eluser]
Hello Everyone
I have some shitty problem right now

when I use
Code:
<a href=""> </a>
its default linked to my existed url

for example condition
my url page is = http://localhost/example/control/user/login

on my html I used
Code:
<a href="&lt;?php echo base_url()?&gt;control/user/register">register</a>
( FYI = my base_url = "http://localhost/example")

when I click the link its direct to
"http://localhost/example/control/user/login/control/user/register"

and I test change my link to
Code:
<a href="www.google.com">register</a>
its directed to
"http://localhost/example/control/user/login/www.google.com"

what I must supposed to do??
regards
#2

[eluser]siptik[/eluser]
hi! Use the html tag &lt;base href="yor_base_url"/&gt;

for example:
Code:
<!DOCTYPE HTML>
&lt;html&gt;
    &lt;head&gt;
&lt;meta charset="utf-8"&gt;
        &lt;base href="&lt;?=base_url()"/&gt;
      &lt;/head&gt;
.....

your links:
Code:
<a href="control/user/register">
or
Code:
<a href="&lt;?=base_url();?&gt;control/user/register">

Code:
NOTE:
1)   <a href="http://www.google.com">
2) $config['base_url'] = 'http://localhost/example';

#3

[eluser]harris_priambudi[/eluser]
It works!
Thanks problem Solved
Big Grin




Theme © iAndrew 2016 - Forum software by © MyBB