I have PHP code

Using .htaccess mod-rewrite

for company_name-ID.html TO index.php?id=ID

the code gives me filename as index.php what I need is company_name-ID.html

The code I am using is

$currentFile = $_SERVER['PHP_SELF'];
$parts = explode('/', $currentFile);
$currentFile = $parts[count($parts) - 1];

Please help me

Edited by nav33n: Please use [code] [/code] tags to wrap your code for easy readability.

7 Years
Discussion Span
Last Post by it200219

show the complete code
including the mod_rewrite code from the .htaccess file in

[code=php] code [/code] for php [code=apache] code [/code] for .htaccess


Edited by almostbob: n/a


Because of security in data / code, I cant shere that here. Let me know what other details I can send it to you.


I have emailed you what I have in my code. Thank you

Please keep it on the site. That's what the forum is for. :)

Edited by nav33n: n/a


if answered, will be answered in this forum,
but I think I will likely ignore you

if you want a secure service, PAY SOMEONE,

nobody is here at your service
nobody has asked for any identifying passwords, just the code that you cannot fix

dont go to a volunteer board tell the posters you think they are criminal,
and demand help

Edited by almostbob: n/a



Please please dont misunderstand me and I am not thinking like that

Well, as I didnt shared code, that doesnt mean I am a bad guy.

Thank you for your comments.

Here is a code I am using in joomla for getting current filename

function curPageName() {
 return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);

Let me know what more details you need from me

Edited by it200219: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.