i have created a generic template which should display the content of the parameter being passed in the URL by fetching details from the database.
Ex.
Home page: index.php
Template: Pages.php
link displayed on Home page: "This is fetched from Database"
when clicked it should navigate to: Pages.php/This is fetched from Database (this is the parameter passed to the database to get the content)
This is working properly but when the i click Home (index.php) in Pages.php/This is fetched from Database the same is being treated as Pages.php/index.php but it should go to index.php directly.
I have used htaccess for rewriting the url but it didnt workout.
Basically i am building a dynamic website and my question is how can i effectively use the generic template concept for achieving the dynamic website?
The code i used for getting this Pages.php/This is fetched from Database
<?php
$mysqli = new mysqli("localhost", "root", "12345", "dbname");
$uri = $_SERVER["REQUEST_URI"];
$uri = $uri[4];
$result = $mysqli->query("SELECT Title FROM Posts where Title = $uri");
echo "<a href = '"./pages.php/{$row["Title"]}."' alt = "">{$row["Title"]}
</a>";
?>