problem of link [solved problem] |
Hello
here my difficulty: I want to establish a link towards another view with this code: PHP Code: <H2 class="centrage"><A href="<?php echo site_url('Curriculum'); ?>">Contactez moi !</A></H2> I have an error 404 here the file //controllers/Homepage.php ( principal controller) PHP Code: <?php and here the file /config/config.php PHP Code: <?php I use codeigniter 3 thank you for your assistance
French citizen (please excuse me for my english )
Having a good knowledge of the PHP but novice with CodeIgniter I use CodeIgniter 3
In simple english, your link is trying to access the controller 'Curriculum'!!
Since 'Curriculum is a method of 'Homepage' controller, your link should be: PHP Code: <h2 class="centrage"><a href="<?php echo site_url('homepage/curriculum'); ?>">Contactez moi !</a></h2>
Try this
Code: <H2 class="centrage"><A href="<?php echo site_url('homepage/curriculum'); ?>">Contactez moi !</A></H2> Or, since the "URL Helper" seems to be loaded Code: <H2 class="centrage"><?php echo anchor('homepage/curriculum', "Contactez moi !"); ?></H2>
Make sure you autoload the url helper in config.php.
The link should be: PHP Code: <h2 class="centrage"><?php echo anchor('homepage/curriculum','Contactez moi !');?></h2> So, include the controller name, followed by the method in the controller. Only use lowercase in links to controller/methods. Also avoid uppercase for html tags.
hello
thank you for your assistance. but method: PHP Code: <h2 class="centrage"><?php echo anchor('homepage/curriculum','Contactez moi !');?></h2> give me URL following: http://127.0.0.1/codeigniter/homepage/curriculum is the error 404
French citizen (please excuse me for my english )
Having a good knowledge of the PHP but novice with CodeIgniter I use CodeIgniter 3
otherwise if I employ
PHP Code: <h2 class="centrage"><?php echo anchor('curriculum','Contactez moi !');?></h2> I have like answer "Not Found The requested URL /codeigniter/curriculum was not found on this server. Apache/2.4.17 (Win64) PHP/7.0.0 Server at 127.0.0.1 Port 80
I have a suspicion so please humor me: What happens if you use this?
PHP Code: <h2 class="centrage"><a href="http://127.0.0.1/codeigniter/index.php/homepage/curriculum">Contactez moi !</a></h2>
that functions impeccably
I have the good file
French citizen (please excuse me for my english )
Having a good knowledge of the PHP but novice with CodeIgniter I use CodeIgniter 3
Quote:that functions impeccably Comme je l'attendais. My next guess is that you do not have an .htaccess file in place. (Documentation Here). It will allow you to construct URL's without "index.php" in them. If you use .htaccess (requires mod_rewrite) the examples first shared should work.
I have the file .htaccess
Code: RewriteEngine on and the option “rewrite_module” activated in apache
French citizen (please excuse me for my english )
Having a good knowledge of the PHP but novice with CodeIgniter I use CodeIgniter 3 |
Welcome Guest, Not a member yet? Register Sign In |