anchor bug |
[eluser]codeman[/eluser]
Hi guys, i was using the anchor tag here for a href link, Here is my code: Code: $this->load->helper('url'); and here is what i get: http://example.com/index.php/www.google.com instead of www.google.com why is this? How do i fix it? Thanks, HP
[eluser]Dam1an[/eluser]
The anchor function is only meant for internal links, you'll have to stick with manualy HTML tags for external links
[eluser]codeman[/eluser]
Cool thanks - But i am still having problem When i go to my view and view.php file, where i put Code: <a href="www.google.com" target="_parent"> Click here now</a> Still it does not work, it still gives me http://localhost/index.php/product/blog/www.google.com Why is it happening ,
[eluser]bobbybaboon[/eluser]
try: Code: <a href="http://www.google.com" target="_parent"> Click here now</a> You need to add "http://" before your url. And just so you know, the target attribute has been deprecated so if you're using a strict doctype it won't be valid.
[eluser]codeman[/eluser]
Cool it worked for both in anchor and a href Thanks,
[eluser]Zeeshan Rasool[/eluser]
Its not some sort of restriction, You can also use anchor for this purpose. :-) try this.. Code: <?php echo anchor('http://www.google.com','google');?> keep going.
[eluser]Dam1an[/eluser]
[quote author="zEsHaN" date="1241084020"]Its not some sort of restriction, You can also use anchor for this purpose. :-) try this.. Code: <?php echo anchor('http://www.google.com','google');?> keep going.[/quote] Ah, so as long as you have the full prefix its ok? I thought its main purpose was for internal links which aren't dependant on full paths (aka built on the fly based on base_url)
[eluser]Thorpe Obazee[/eluser]
I actually didn't know that that worked too. Maybe that should be added to the user_guide, no?
[eluser]Zeeshan Rasool[/eluser]
Quote:Ah, so as long as you have the full prefix its ok?Its not my wording dude, you can take help from user guid. > ---->read user manul |
Welcome Guest, Not a member yet? Register Sign In |