Newbie to Ignite. Please help! Links doesnt work!!! - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Newbie to Ignite. Please help! Links doesnt work!!! (/showthread.php?tid=22712) Pages:
1
2
|
Newbie to Ignite. Please help! Links doesnt work!!! - El Forum - 09-18-2009 [eluser]SonamL[/eluser] Please helppp... I m a newbie to Ignite. I am not able to make the links work. I m following the video tutorial on the website. ... like i have this:- Test This is TEST Comments Second Test this is second test Comments SO when i click on to Comments- it doesnt work but however if i go by loading the url for the same i am able to get the content! Please help! what's wrong ?? .... This is my View file:- html> <head> <title><?=$title?></title> </head> <body> <?php foreach($query->result() as $row):?> <h3><?=$row->title?></h3> <p><?=$row->body?></p> <p><?=anchor('site/comments/'.$row->id, 'Comments');?></p> <hr> <?php endforeach; ?> </body> </html> Thanks Newbie to Ignite. Please help! Links doesnt work!!! - El Forum - 09-18-2009 [eluser]rogierb[/eluser] 1: do not use short_tags, it's only for lazy programmers :-) 2: use base_url() to get full uri's, you now have one relative to the controller <code> <?=anchor(base_url().‘site/comments/’.$row->id, ‘Comments’);?> </code> Newbie to Ignite. Please help! Links doesnt work!!! - El Forum - 09-18-2009 [eluser]Dam1an[/eluser] [quote author="rogierb" date="1253281109"] 2: use base_url() to get full uri's, you now have one relative to the controller <code> <?=anchor(base_url().‘site/comments/’.$row->id, ‘Comments’);?> </code>[/quote] If anything, you'd use site_url as it includes index_page (which is normally empty) Also, anchor build it using the site URL anyway Have you got the url helper loaded? Newbie to Ignite. Please help! Links doesnt work!!! - El Forum - 09-18-2009 [eluser]SonamL[/eluser] Changed to :-<?=anchor(base_url().‘site/comments/’.$row->id, ‘Comments’);?> And I get this error: A PHP Error was encountered Severity: Notice Message: Use of undefined constant ‘site - assumed '‘site' Filename: views/hometest.php Line Number: 12 I loaded the url helper. $autoload['helper'] = array('url'); Please Helppp! Newbie to Ignite. Please help! Links doesnt work!!! - El Forum - 09-18-2009 [eluser]SonamL[/eluser] Same problem with this. The form is not getting posted <html> <head> <title><?=$title?></title> </head> <body> <?=form_open('blog/comment_insert');?> <?=form_hidden('entry_id',$this->uri->segment(3));?> <p><textarea name="body" rows="10"></textarea></p> <p><input type="text" name="author"/></p> <p><input type="submit" value="Submit Comment" /></p> </form> </body> </html> Newbie to Ignite. Please help! Links doesnt work!!! - El Forum - 09-18-2009 [eluser]Dam1an[/eluser] Have you definatly changed the base_url in the config file? What are the links it creates? And use [ code ] tags in future when posting code Newbie to Ignite. Please help! Links doesnt work!!! - El Forum - 09-18-2009 [eluser]SonamL[/eluser] The Base url is : Code: $config['base_url']= "http://localhost/CI/index.php" I'm not able to post comments. I dont get the error page as well. it directs me a new page all together , like my AVG page when i post a comment. same for the earlier problem. The error page doesnt display as well Thanks Newbie to Ignite. Please help! Links doesnt work!!! - El Forum - 09-18-2009 [eluser]Dam1an[/eluser] the base URL shouldn't include index.php, that's a seperate config item change it to Code: $config['base_url']= "http://localhost/CI/ Newbie to Ignite. Please help! Links doesnt work!!! - El Forum - 09-18-2009 [eluser]SonamL[/eluser] Ok Great .it Works. Thanks alot :-) Newbie to Ignite. Please help! Links doesnt work!!! - El Forum - 09-18-2009 [eluser]SonamL[/eluser] But the insert redirects to another page again!!! new page. |