[SOLVED] Redirect |
Hello,
Can anyone help me fix this navigation so that it could redirect to google analytics website? views/navigation.php PHP Code: <li><a href="<?php echo site_url('cpages/settings'); ?>"><i class="icon icon-th-list"></i> <span>Settings</span></a></li> Cpages/googleanalytics.php PHP Code: public function googleanalytics() { config/routes.php PHP Code: $route['cpages/googleanalytics'] = 'cpages/googleanalytics'; Views/googleanalytics.php PHP Code: <html>
" If I looks more intelligence please increase my reputation."
Forget the whole thing about routing.
Simply put the following code in your navigation.php file: PHP Code: echo anchor('https://accounts.google.com/ServiceLogin?elo=1','Google Analytics'); In order to use the anchor function, you need to load the url helper. It's a good idea doing that in the config/autoload.php file: PHP Code: $autoload['helper'] = array('url'); Besides that, if you want to link to URL's within your own website, you don't need to include site_url at all. This will do: PHP Code: echo anchor('cpages/settings','Settings'); And you DON'T need a routing if the url itself is good enough. A line like you have: PHP Code: $route['cpages/googleanalytics'] = 'cpages/googleanalytics'; Routing is needed if you want your url to point to a different controller/method. So this would make sense: PHP Code: $route['tools/googleanalytics'] = 'cpages/googleanalytics';
Hello,
Can anyone help me fix the appearance that appear in the navigation for google analytics navigation tabs? This is what I try : views/navigation.php PHP Code: <li><a href="<?php echo anchor('https://accounts.google.com/ServiceLogin?elo=1','Google Analytics'); ?>"><i class="icon icon-th-list"></i> <span>Google Analytics</span></a></li> This is the original before revision: PHP Code: <?php <li><a href="<?php echo site_url('cpages/googlenalytics'); ?>"><i class="icon icon-th-list"></i> <span>Google Analytics</span></a></li> ?> Can anyone help me fix the code so that I achieve the same result? Thanks in advance.
" If I looks more intelligence please increase my reputation."
Will this make clear how you should use the anchor function?
PHP Code: <?php The anchor function builds the <a href="..."> </a> tags for you, so you should not put those around the link yourself. Just take some time to read the documentation about the anchor function.
views/navigation.php
PHP Code: <li><a href="<?php echo anchor('https://accounts.google.com/ServiceLogin?elo=1','Google Analytics'); ?>"><i class="icon icon-th-list"></i> <span>Google Analytics</span></a></li> After I click "Google Analytics" then it starts: http://127.0.0.1/CompanyGiondaCI/index.p...3Ca%20href= This is the page: An Error Was Encountered The URI you submitted has disallowed characters.
" If I looks more intelligence please increase my reputation."
Of course you get an error. You didn't do anything with the reply I gave you yesterday at 7:30 am.
Hello Wall!
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(07-31-2016, 06:53 PM)davy_yg Wrote: views/navigation.php Remember <a href="..., if you use a anchor(...) PHP Code: <li><a href="<?php echo anchor('www.google.com','Google Analytics'); ?>"><i class="icon icon-th-list"></i> <span>Google Analytics</span></a></li> If I click the link, this link appears: htp://127.0.0.1/CompanyGiondaCI/%3Ca%20href= , I wonder why? ( I expect it goes to www.google.com)
" If I looks more intelligence please increase my reputation."
I wonder why you ignore the helpful tips and solutions that other forum members are giving you. You're asking the same questions over and over again. If you don't understand what's wrong with an anchor(..) link between <a href=""> and </a> tags, then you aren't up to working with CodeIgniter yet.
First learn to understand php, html, css and javascript. Now, you're asking how to build a house, but you have no idea what bricks and boards are for. No wonder why the number of replies to your posts is declining. It seems that every minute we spend on helping you, is a waste of time. I suggest that you lock yourself up for 3 days and spend all the time you have on reading the CI documentation (which is really good!). I don't mean to be rude, but if that doesn't bring you any further, please drop your ambition to become a CI developer. |
Welcome Guest, Not a member yet? Register Sign In |