• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Link problem

#1
[eluser]Gerep[/eluser]
Hi,

I'm creating my first website with CI but I'm having a problem with links.

http://www.redenoos.com.br

On my menu I have 3 links, Home, Sobre, Contato.

The code:
Code:
<a href="&lt;?php echo site_url('home') ;?&gt;">Home</a>

But online it shows http://localhost/redenoos/home and shouldn't it be http://www.redenoos.com.br/home ?

Another problem is with my contact form.

Code:
&lt;form method="post" action="contato/enviar"&gt;

The form is been sent and display error messages but when we send the email and click on any of the menu links it adds the link value to the url.

Thanks for your time and attention and sorry for any typos =)

#2
[eluser]smilie[/eluser]
Hi,

1. What are the links for Sobre and Contanto?

2. Obviously, look for the error on:
Fatal error: Call to a member function from() on a non-object in /home/storage/2/ec/df/danielgerep/public_html/redenoos/system/application/controllers/contato.php on line 39

Cheers,
Smilie

#3
[eluser]danmontgomery[/eluser]
[quote author="Gerep" date="1288742233"]But online it shows http://localhost/redenoos/home and shouldn't it be http://www.redenoos.com.br/home ?[/quote]

This is defined in $config['base_url'] in application/config/config.php

[quote author="Gerep" date="1288742233"]The form is been sent and display error messages but when we send the email and click on any of the menu links it adds the link value to the url.[/quote]

I don't know what this means? Give an example?

#4
[eluser]Gerep[/eluser]
noctrum, your solution worked fine, thanks.

About the form:
Code:
&lt;form method="post" action="contato/enviar"&gt;

When I submit the form, it adds the "enviar" method to the URL and when I click on another link, i.e. Home, the URL goes like this: www.redenoos.com.br/contato/enviar/home when it should be www.redenoos.com.br/home.

I'm sorry but my English is not that good... =)

#5
[eluser]Christophe28[/eluser]
Have you set /contato/enviar as your default controller method to be load? Or maybe you have set $config[‘base_url’] to 'www.redenoos.com.br/contato/enviar/' in your config.php ?

Christophe

#6
[eluser]Gerep[/eluser]
My
Code:
$config['base_url'] = 'http://www.redenoos.com.br/';

The enviar method is not the default...it has to be?

Thanks

#7
[eluser]Christophe28[/eluser]
Nono, it shouldn't be the default ;-)

I just don't quite understand what you mean ... If you create a link like this:

Code:
<a href="/home">Home</a>

You will come to your homepage wherever you are on your website.


Or have you create your link without a slash before home in your href ...?

Code:
<a href="home">Home</a>

When you click this link on /segment1/segment2/ you will come on /segment1/segment2/home instead of /home. Perhaps that's the problem?

Christophe

#8
[eluser]Gerep[/eluser]
Hi Christophe, the link problem was solved...thanks =)

#9
[eluser]Christophe28[/eluser]
Super!


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.