Note that there are some explanatory texts on larger screens.

plurals
  1. POwhy isn't index.php working?
    text
    copied!<p>I have a single index.php page that should link to the rest of my websites.</p> <pre><code>&lt;?php if(!isset($_GET['page']))$page = 'home.php'; else{ $page = $_GET['page'] . ".php"; } include("_includes/header.php"); include("_includes/navigation.php"); include("_pages/$page"); include("_includes/footer.php"); ?&gt; </code></pre> <p>This is what my index.php looks like. It's supposed to get the page i click on (when i clikc on the navigation) and direct it to this page so that the header, navigation, and footer will be reused for every page.</p> <pre><code>&lt;div id="navi"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="home"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="skills.php"&gt;Skills&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="_pages/my_projects.php"&gt;Projects&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="_pages/experience"&gt;Experience&lt;/i&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="_pages/personal"&gt;About&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="_pages/contact"&gt;Contact&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>according to the code the "home" link should work but it says URL not found because it is looking for "home" in the directory that I'm in. however its in my pages directory. "skills" does the same thing. the only ones that do work is the links projects through contact because i am specifying a path. however, the links that work don't go through my index page because the header.php (which contains the css), navigation.php, and footer.php is not included here.</p> <p>i did research and i found that i had to do something with the .htaccess file and/or something with mod_rewrite. can someone please help me out. I've been looking for about 2-3weeks now and nothing.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload