forked from SnowHall/Silurus-Classifieds-Script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rewrite_name.php
executable file
·53 lines (46 loc) · 1.28 KB
/
rewrite_name.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
* Silurus Classifieds Builder
*
*
* @author SnowHall - http://snowhall.com
* @website http://snowhall.com/silurus
* @email support@snowhall.com
*
* @version 1.0
* @date May 7, 2009
*
* Silurus is a professionally developed PHP Classifieds script that was built for you.
* Whether you are running classifieds for autos, motorcycles, bicycles, rv's, guns,
* horses, or general merchandise, our product is the right package for you.
* It has template system and no limit to usage with free for any changes.
*
* Copyright (c) 2009
*/
@list($url, $vars) = explode('?', $_SERVER['REQUEST_URI']);
if( $url == '/' )
{
require_once('index.php');
exit;
}
$urlArr = explode('/', $_SERVER['REQUEST_URI']);
$rewriteNick = (strlen(trim($urlArr[count($urlArr) - 1])) ? $urlArr[count($urlArr) - 1] : $urlArr[count($urlArr) - 2]);
if ( !get_magic_quotes_gpc() )
{
$rewriteNick = addslashes($rewriteNick);
}
include("./include_php/init.php");
$sRequest = "SELECT `ID`,`NickName` FROM `Profiles` WHERE NickName='{$rewriteNick}'";
$profArr = mysql_fetch_assoc(mysql_query( $sRequest ));
if ($profArr)
{
header( 'location: /profile.php?ID='.$profArr['ID'] );
exit();
}
else
{
header("HTTP/1.0 404 Not Found");
header("Status: 404 Not Found");
echo "Page not found $tmp";
}
?>