CodeIgniter Forums

Full Version: call another html page not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am having one html file. I am using navigation bar contained lot of menus. each menu call one html

Actual program.
*************
 <li><a href="#edu">Education</a></li>

#edu 
---some html files ----


I want to be
 <li><a href="edu.html">Education</a></li>

I will not open. in the page view source If i click that link , it's open . whats wrong in my code
@kvanaraj,

It depends on where the page exist on the website. Is edu.html at the root of the web site directory or is it in a subdirectory? for example:
www.mywebsite.com/edu.html
or
www.mywebsite.com/subdirectory_name/edu.html

Also, are you sure that the page name is edu.html (not edu.php)? Can you get to the page directly? If so, what is the url that you use?
Why is this question in the CodeIgniter forum?
CodeIgniter typically doesn't call any html pages. You access pages through a controller that loads a view, optionally after getting data from a model. That's why it's called the MVC approach (Model - View - Controller).
@Wouter60,

I actually disagree with your statement. Yes, CI is an MVC framework but it is versatile enough to be able to make a call to an html page.
(07-09-2018, 09:29 AM)php_rocs Wrote: [ -> ]@kvanaraj,

It depends on where the page exist on the website.  Is edu.html at the root of the web site directory or is it in a subdirectory? for example:
www.mywebsite.com/edu.html
or
www.mywebsite.com/subdirectory_name/edu.html

Also, are you sure that the page name is edu.html (not edu.php)?  Can you get to the page directly?  If so, what is the url that you use?

http://localhost/project1/about.html
this about.html is in same project1 directory
@kvanaraj,

This is a choice of absolute or relative links. I prefer absolute links because no matter where the link appears it will always work where as a relative link will only work based on the location of the page (if you use relative link in sub directory it will not work).

I would make your link like this:
Create a PHP variable in the html file so that you only have to change the site url once through the file (You could also do an required or include file of variables)
<?php $url = 'https://www.yourwebsite.com/'; ?>

Then down in your html page
<li><a href="<?php echo $url; ?>edu.html">Education</a></li>