CodeIgniter Forums

Full Version: Link buttons not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi.
I followed the tutorial. 
I have done all the tasks up to this page.
For some reason when I try to submit this simple form the framework try to redirect me to this address: http://0.0.0.0/news/create, and this address not exist of course.
I added some record to my empty DB just to check if the other pages is working well and to test the links in the 'news' page.
When I try to press on one of the View_article links its also redirect me to the same strange address, http://0.0.0.0/news/Good-news for example.

When I inspect the web page code generated by the framework I can see that 
<?php echo site_url('news/'.$news_item['slug']); ?>

is translated to the previous address, http://0.0.0.0/news/Good-news for example, So for some reason the site_url method generate this address.

Probably due to the value assigned to $config['base_url'] in application/config/config.php
Read the comments in the file carefully and follow the directions.
@farkash7,

What's your development stack? Are you using the most current version of CI? Is your code exactly like the tutorial code?
Hi thank. It really was the config.php file.
I set the 'base_url' in the config.php file to my server ip (If someone is reading this thread in the future make sure you not forget the http:// prefix and the / suffix).
I also set the index page to the right value (empty string in my case because my server start file is set to index.php).

Now everything is working and I can continue with the tutorial.

Thank you very much guys!
This is basic CodeIgniter setup in the Users Guide.

You always set the base url in the config file to your site.