
October 3rd, 2012, 02:33 PM
|
|
Contributing User
|
|
Join Date: Feb 2011
Posts: 306
  
Time spent in forums: 1 Day 18 h 23 m 55 sec
Reputation Power: 5
|
|
|
Change header id to my seo friendly url?
I was able to create a function that would make an seo friendly url. My question is how do I change:
example.com?scamid=5
to:
example.com/jims-service-center-collission-repair-scam.html
Here is my index.php file:
Code:
<?php
include_once "templates/head.phtml";
$scamid = $_GET['scamid'];
if (isset($scamid))
{
include_once "templates/scam.phtml";
}
elseif (!isset($scamid))
{
include_once "templates/home.phtml";
}
include_once "templates/footer.phtml";
?>
Here is my scam.phtml file which should redirect to the seo friendly url above.
Code:
require_once "dbConnection.php";
$query = "select * from bad_words";
$result = mysql_query($query);
while ($record = mysql_fetch_assoc($result))
{
$words_array[] = $record['word'];
}
$sql = "SELECT * FROM reported_scams WHERE id=".$_GET['scamid'];
$rs_result = mysql_query($sql);
while ($row = mysql_fetch_array($rs_result)) {
$link = $row['business'];
}
require_once "functions/seourls.php";
$link = generate_seo_link($link, '-', true, $words_array);
// $siteurl is equal to http://www.example.com/
//$link is equal to jims-service-center-collission-repair-scam.html
So how can I use the header function to make this work or mod_rewrite ? Thanks, I'm still a newbie in learning 
|