Building a Relational Content Management System in PHP/MySQL - The Rewrite
(Page 2 of 5 )
The mod_rewrite for this script is pretty simple. We basically pass everything to the script to decode.
Create a file called ".htaccess":
RewriteEngine on
RewriteRule ^(.*).html$ index.php?seoname=$1&mode=view
[QSA,L]
This will make the files all look like a .html file.
The Config
Okay, we need to set up a config.php file to hold the config info.
Create a file called "config.php":
<?
$sitename = "";// site name
$siteurl = "";// site url
$aduser = "";// admin username
$adpass = "";// admin password
$dbhost = "";// database hostname
$dbuser = "";// database username
$dbpassword = "";// database password
$dbname = "";// database name
?>
These settings are important and should be set before we start. The variables are broken down as follows:
$sitename=The name of your website
$siteurl=The URL to the affiliate script as it is installed on
your site
$aduser=Your management login username
$adpass=Your management login password
$dbhost=Your database host (usually localhost)
$dbuser=Your database username
$dbpassword=Your database password
$dbname=The name of your database
Next: The Common Functions >>
More PHP Articles
More By Roger Stringer
|
| · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | | |
|