I currently have 4 pages(about, interviews, ask a q, contact) per people and I have 250+ people and it takes a long time to create a new people to the site
What is the best way to have just 4 pages(about, interview, ask a q, contact) that loops through the database people and creates their pages on the fly when the user requests them?
here's an example of a person on the site http://starsQA.com/aaron-cole
I'm thinking of using $_GET variables from the database and changing the url using .htaccess rewriting, but I have no clue how to do this or if it's even possible
the site uses html, php, mysql and oop
What is the best way to achieve this?
I have added this:
<?php session_start();
error_reporting(E_ALL ^ E_NOTICE);
include("db_conn.php");
$qry_string = "select * from stars INNER JOIN roles ON roles.starID = stars.starID where stars.starID = ?";
$prep = $pdo_conn->prepare($qry_string);
$prep->execute(array($_GET['id']));
$result = $prep->fetch(PDO::FETCH_ASSOC);
$pieces = explode(" ", $result['starName']);
$gender = "him";
?>
and now if you use http://www.starsqa.com/about?id=52 you can aaron cole and id=6 lindsey mckeon
How to figure out how to change the url to http://www.starsqa.com/about?id=52 to http://starsQA.com/aaron-cole-about
tried this, but i didn't seem to work: sending a user from starsQA.com/aaron-cole-about to starsQA.com/about?id=52) :
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^/aaron-cole-about$ /about?id=52 [L]
here's my current .htaccess file
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !\.php$
RewriteRule ^(.*)$ $1.php [L,QSA]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^/aaron-cole-about$ /about?id=52 [L]
Is it possible that the user entered in aaron-cole-about and behind the scenes it uses about?id=52 but still shows the user aaron-cole-about ???