I own the site: www.xgaming.org which is running on a gaming cms. Under the page: http://xgaming.org/companies.php,
the companies come under number id's eg: http://xgaming.org/companies.php?do=view&id=1
Would it be possible to make it so instead of the id's as numbers, they would be under their names eg:
/companies.php?do=view&name=COMPANYNAME
?
The code for the companies page is:
<?php
class Module
{
function main()
{
global $db;
$result = $db->Execute("SELECT id, title FROM sp_companies ORDER BY title;");
while ($row = $result->FetchNextObject())
{
$companies_list .= '<a href="companies.php?do=view&id='.$row->ID.'">'.clean($row->TITLE).'</a><br />';
}
include "templates/companies_list.inc.php";
}
function view()
{
global $db;
if ( !is_numeric($_REQUEST['id']) )
{
die("Critical Error: Aborting script operations.");
}
$result = $db->Execute("SELECT * FROM sp_companies WHERE id = $_REQUEST[id] LIMIT 1");
$company = array();
$company['title'] = stripslashes($result->fields['title']);
$company['description'] = clean($result->fields['description']);
if ( !empty($result->fields['homepage']) )
{
$company['homepage'] = '<a href="' . stripslashes($result->fields['homepage']) . '" target="_blank">'
. stripslashes($result->fields['homepage']) . '</a>';
}
if ( !empty($result->fields['logo']) )
{
$company['logo'] .= "<img src=\"";
$company['logo'] .= stripslashes($result->fields['logo']);
$company['logo'] .= "\" alt=\"" . $company['title'] . " align=\"right\" hspace=\"2\" vspace=\"2\">";
}
$result = $db->Execute("
SELECT id, title, section, developer
FROM sp_games
WHERE developer = " . $_REQUEST['id'] . "
ORDER BY title;");
while ( $row = $result->FetchNextObject() )
{
$company['dev_links'] .= '<a href="gamedetails.php?id='.$row->ID.'">'.stripslashes($row->TITLE).'</a><br />';
}
$result = $db->Execute("
SELECT id, title, section, publisher
FROM sp_games
WHERE publisher = " . $_REQUEST['id'] . "
ORDER BY title;");
while ( $row = $result->FetchNextObject() )
{
$company['pub_links'] .= '<a href="gamedetails.php?id='.$row->ID.'">'.stripslashes($row->TITLE).'</a><br />';
}
include "templates/companies_details.inc.php";
}
}
?>
and I can't seem to edit it. I know this probaby seems really easy, but could someone help? Thanx